我有连接SqlDataSource的GridView,我希望在OnRowUpdating事件中我的条件为false时取消更新行?怎么做?谢谢。
答案 0 :(得分:5)
尝试
protected void Page_Load(object sender, EventArgs e)
{
GridView1.RowUpdating += new GridViewUpdateEventHandler(GridView1_RowUpdating);
}
void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
e.Cancel = true;
}