Radgrid onselectedindexchanged for 2 buttons

2 posts, 0 answers
  1. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 12 Jan 2011 Link to this post

    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.










  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Jan 2011 Link to this post

    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.

Back to Top