This is a migrated thread and some comments may be shown as answers.

how to obtain grid template column image button click

1 Answer 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
s
Top achievements
Rank 1
s asked on 10 Oct 2008, 11:49 AM

In my asp.net application, rad grid consists of two image control column and one checkbox column for multiple row selection. One of the image control column is delete and delete command gets fired on image click since command name specified is 'Delete'. I defined one template column having another image.
What i want is if i selected multiple rows with check boxes then the particular routine should called on image2 click.
In my grid_itemdatabound event i have written this code:

 

 

ImageButton img2 = (ImageButton)dataItem["uniquename"].FindControl("ImgId");

 

img2 .Click +=

new ImageClickEventHandler(img2 _Click);

protected void  img2_Click(object sender, ImageClickEventArgs e)

 

 

{
//  some code that is to be executed, loop through grid rows, check if checkbox checked, execute routine
}

when i debug i fnd img2_click does get called


anyone who knows please tell how this can be achieved.

which command event i should use as delete i am already using for deleting multiple rows selected.
Please tell ASAP or provide some code.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 14 Oct 2008, 06:39 AM
Hi s,

Try to replace the code you have for handling ImageButton.Click from ItemDataBound to ItemCreated instead.
Have in mind that ItemDataBound won't fire on every Page postback. You can find more information here

Regards,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
s
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or