Many Buttons on the row

2 posts, 1 answers
  1. lupotana
    lupotana avatar
    73 posts
    Member since:
    Nov 2006

    Posted 29 Oct 2013 Link to this post

    Hi,
    I would a grid with many ImageButtons on the row that call many different function.
    In this row I've yet the button of Select and Delete.

    How can I do this ?

    Thanks
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Oct 2013 Link to this post

    Hi Iuptana,

     I'm not clear about your requirement,i guess you want to have buttons on your rows.You can either use a GridButtonColumn or a GridTemplateColumn and add ImageButton to its ItemTemplate,you can access each button separately using its CommandName.Please try the following code.

    ASPX:
    <telerik:GridButtonColumn ButtonType="PushButton" Text="Select" CommandName="Select">
    </telerik:GridButtonColumn>
    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete">
    </telerik:GridButtonColumn>
    <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="" CommandName="Button1"
        UniqueName="Button1">
    </telerik:GridButtonColumn>
    <telerik:GridTemplateColumn>
        <ItemTemplate>
            <asp:ImageButton ID="ImageButton1" runat="server" CommandName="ImgButton" />
        </ItemTemplate>
    </telerik:GridTemplateColumn>

    C#:
    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "Button1")
        {
          //Your code
        }
        else if (e.CommandName == "ImgButton")
        {
          //Your code
        }       
    }

    Thanks,
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top