Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
I have placed GridView Ctrl and html <img> in it .. Now I wants to display selected image from gridview in the another image control But GridView1_SelectedIndexChanged event is not triggering when clicking on image in grid .... Can anybody help me .. Thank s in advance.
Posted
Updated 24-May-11 19:15pm
v3
Comments
Mohd Wasif 24-May-11 8:10am    
Please clarify Wat do u want.
What do want to on clicking image .
sairam.bhat 25-May-11 2:40am    
good qstn
sairam.bhat 25-May-11 2:41am    
my +5

The SelectedIndexChanged event is triggered when the a row of the GridView is selected.
Now first of all you'll have to configure the GridView to allow for Selection of rows.

The simples way to do this is to auto generate the select column by adding the attribute as follows
VB
<asp:gridview id="CustomersGridView"
      autogenerateselectbutton="True">



The second way is to use a customized LinkButton, Button, ImageButton. I could only guess that's what you're trying to do. Since you didn't provide any code i can not tell for sure!
If you're trying to do it this way you'll have to consider that in this case the SelectedRowEvent isn't raised. What is happening is after the Button was clicked a RowCommand is raised which can be used to set the specific row into SelectionMode thereby raising the SelectedRowEvent.

Improve your question if you're really interested in additional help.

See also this post with a similar question:
Row Command in gridview.[^]
 
Share this answer
 
v4
Comments
Legor 25-May-11 2:37am    
Whats the downvote for ?
sairam.bhat 25-May-11 2:40am    
good ans
sairam.bhat 25-May-11 2:41am    
my +5
Please try with image button control to show images instead of image control..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900