开发者

Telerik RaGrid - How to add Edit column at design time

This is a column in my Telerik Rad Grid

<telerik:GridTemplateColumn HeaderText="Action" UniqueName="d开发者_如何学CtgColActions"  Groupable="false" Reorderable="false">
    <ItemTemplate>
        <asp:LinkButton ID="lnkActionEdit" runat="server" OnClicks="lnkEdit_Click">Edit</asp:LinkButton>
        <asp:LinkButton ID="lnkActionArchive" runat="server" OnClicks="lnkArchive_Click">Archive</asp:LinkButton>
    </ItemTemplate>
</telerik:GridTemplateColumn>

How can I link each Edit / Archive Link to the id of that specific row?


Here's the Solution

        protected void lnkEdit_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton lb = new LinkButton();
                lb = (LinkButton)sender;
                Control control = lb.NamingContainer;
                GridDataItem gridDataItem = (GridDataItem)control;

                int itemId= Convert.ToInt32(gridDataItem["dtgColItemId"].Text);

                Response.Redirect("/yourpage.aspx?id=" + itemId);
            }
            catch
            {

            }
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜