troubleshooting Question

How to change the image of gridview cell at runtime?

Avatar of meispisces
meispiscesFlag for India asked on
.NET ProgrammingC#ASP.NET
3 Comments1 Solution333 ViewsLast Modified:
I have a gridview that contains a column name "History" which has Plus (+) image button.

Clicking on the plus image button results in addition of new row beneath. Insertion of a new row should change the image of Plus image button to Minus (-) image button for that particular parent row only. Rest of the rows should have the Plus image button.

Q1. How to know the row index of the selected row, so that a image could be changed?

Secondly,If i click on Minus Image button, that should reset to Plus Image button and the added child row shouldn't be seen.

Q2. How to change the image back to Plus Image button?

I have added the Plus image button in gridview template field. Hence when grid is being loaded, Plus image is visible.

Please advice!

Thanks!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros