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

Radgrid onselectedindexchanged for 2 buttons

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JJ
Top achievements
Rank 1
JJ asked on 12 Jan 2011, 11:23 PM
I have 2 buttons (GridButtonColumn) on the radgrid doing different action, the first one

 

 

 

<telerik:GridButtonColumn CommandName="Select" DataTextField="TagID" ButtonType="ImageButton"ImageUrl="images/go.gif" UniqueName="colgo" ></telerik:GridButtonColumn

<telerik:GridButtonColumn CommandName="Select" DataTextField="TagID2" ButtonType="ImageButton"ImageUrl="images/go2.gif" UniqueName="colgo2" ></telerik:GridButtonColumn 

 

By using onselectedindexchanged 

 

="rgSearch_SelectedIndexChanged", which allows me to put code behind under 

 

 

 

protected void rgSearch_SelectedIndexChanged(object sender, EventArgs e)

 

 

{
}

How can I idendify under  rgSearch_SelectedIndexChanged, the sender is from which button, in order  to put different action code in.

 

 

 

 

 


Thanks,
Jessie

 

 

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Jan 2011, 08:47 AM
Hello Jessie,


You could set different CommandName for GridButtonColumns and differentiate the button_click in ItemComamnd event. You can use a global variable (flag) and set the flag in ItemCommand event and access it in SelectedIndexChanged event handler.


-Shinu.
Tags
Grid
Asked by
JJ
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or