Reputation: 4565
I have GridView with connected SqlDataSource and I want cancel updating row when my condition is false in OnRowUpdating event? How to do it? Thank you.
Upvotes: 3
Views: 5301
Reputation: 128
try
protected void Page_Load(object sender, EventArgs e)
{
GridView1.RowUpdating += new GridViewUpdateEventHandler(GridView1_RowUpdating);
}
void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
e.Cancel = true;
}
Upvotes: 5