what i want do is to when the user click on Delete button i want to highlight the entire row and ask for confirmation before it deletes, and the below is my code and iw ant to execute two steps:
1) hightlight the entire row
2) ask the for confirmation.
protected void gvOrg_RowDataBound(object sender, GridViewRowEventArgs e)
{
Button btnDelete = (Button)e.Row.FindControl("btnDelete");
if (btnDelete != null)
{
//btnDelete.Attributes.Add("onclick", e.Row.BackColor = System.Drawing.Color.Red);
btnDelete.Attributes.Add("onclick", String.Format(textForMessage, "Id: " + DataBinder.Eval(e.Row.DataItem, "Id"), "Name: " + DataBinder.Eval(e.Row.DataItem, "Name")));
}
}
1 Answer