Hi John,
Thank you for your interest in Syncfusion Products.
We suggest you to enable client side confirmation while deleting the data using GridRowEditUpdateLink ItemTemplate. Please refer the code snippet below to achieve this.
DeleteLinkText="Delete" ShowDeleteLink="true" ShowEditLink="True" runat="server"
CssClass="GridRowEditUpdateTemplate" />
- Add a css class to GridRowEditUpdateLink in order to tag the Delete link.
- Using JQuery, tag the class name for click event.
- Check for the clicked link as "Delete" which is given for DeleteLinkText.
- Return the confirmation.
Refer a sample below which illustrates the above.
http://files.syncfusion.com/support/GGC.Web/7.2.0.37/56853/main.htmSince, the GridRowEditUpdateLink is embedded as ItemTemplate, we need to access its properties and events by finding the TemplateControls through RowDataBound event using FindControl method. Refer the below code snippet which illustrates this.
void GridGroupingControl1_RowDataBound(object sender, RowDataBoundEventArgs e)
{
if (e.Element.Kind == DisplayElementKind.Record)
{
for (int i = 0; i < e.Row.Cells.Count; i++)
{
//"Template" is the column name for GridRowEditUpdateLink template.
if (((Syncfusion.Web.UI.WebControls.Grid.Grouping.GridCell)(e.Row.Cells[i])).ColumnDescriptor.Name == "Template")
{
GridRowEditUpdateLink = (GridRowEditUpdateLink)e.Row.Cells[i].FindControl("GridRowEditUpdateLink1");
if (GridRowEditUpdateLink != null)
{
GridRowEditUpdateLink.Click += new EventHandler(GridRowEditUpdateLink_Click);
}
}
}
}
}
void GridRowEditUpdateLink_Click(object sender, GridRowEditUpdateEventArgs e)
{
switch (e.CommandLinkType)
{
case "Delete":
//your code
break;
}
}
Let me know if these helps you out.
Thanks,
Rekha