Hi, I've a small problem with RadGrid.
I must transform old code with ASP.NET GridView in a new code with Telerik RadGrid.
In old version I've two TemplateField in my GridView : in first column there is a label with the code of row (hide) and in the second column there is an ImageButton with an Handler with the function btnUpdate_Click.
....
<asp:TemplateField Visible="false"> |
<ItemTemplate> |
<asp:Label ID="lblCode" runat="server" Text='<%# Bind("Code") %>' /> |
</ItemTemplate> |
</asp:TemplateField> |
<asp:TemplateField> |
<ItemTemplate> |
<asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/edit.png" OnClick="btnEdit_Click" CausesValidation="false" /> |
</ItemTemplate> |
</asp:TemplateField> |
......
In function btnEdit_Click I cast the row and the Label control in the row and with the code I transfer the page.
protected void btnEdit_Click(object sender, EventArgs e) |
{ |
GridViewRow row = ((GridViewRow)((ImageButton)sender).NamingContainer); |
Label lblCode = (Label)row.Cells[0].Controls[1]; |
Server.Transfer("~/Detail.aspx?Code="+lblCode.Text); |
} |
How do I do this operation with RadGrid?
I don't want use the the Inline solution or client scripts.
I need that when the user click on an imageButton or button in a row I enter in a server side code.
Thanks,
Marco