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.
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;
}
精彩评论