Hello,
I want to call my delete function after clicking the delete hyperlink of my grid. is this possible? how?
Thanks
Printable View
Hello,
I want to call my delete function after clicking the delete hyperlink of my grid. is this possible? how?
Thanks
You can handle the hyperlink's click in the DataGrid's ItemCommand event. Based upon the Item and ItemIndex of the hyperlink clicked, you can perform the corresponding delete/delete function.
mendhak,Quote:
Originally Posted by mendhak
can you give me a sample script?
Thanks
Your template column will look like this:
A linkbutton can be handled server side, so in the itemcommand event of the datagrid:Code:<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton ID="hyl1" Runat="server">mylink</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
VB Code:
Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand Response.Write("Index: " & e.Item.ItemIndex.ToString()) End Sub
Thanks
Welcome.