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

Many Buttons on the row

1 Answer 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
lupotana
Top achievements
Rank 1
lupotana asked on 29 Oct 2013, 07:32 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 29 Oct 2013, 08:37 AM
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
Tags
Grid
Asked by
lupotana
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or