We're having some difficulty with getting the confirmation box to work with the datagrid. We have found examples in tek tips but could not get it to work for us.
Here is the HTML for the delete command:
<asp:ButtonColumn HeaderStyle-CssClass="grid-header" Text="Delete" CommandName="Delete"></asp:ButtonColumn>
And this is what we tried based on an article on this site:
private void ctrlDataGridUsersRoles_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
((Button)e.Item.FindControl("Delete")).Attributes.Add("onClick", "javascript:return confirm('Are You Sure You Wish To Delete This Item ?');");
}
We feel that we are close. If you have any suggestions, we appreciate it.
Here is the HTML for the delete command:
<asp:ButtonColumn HeaderStyle-CssClass="grid-header" Text="Delete" CommandName="Delete"></asp:ButtonColumn>
And this is what we tried based on an article on this site:
private void ctrlDataGridUsersRoles_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
((Button)e.Item.FindControl("Delete")).Attributes.Add("onClick", "javascript:return confirm('Are You Sure You Wish To Delete This Item ?');");
}
We feel that we are close. If you have any suggestions, we appreciate it.