【发布时间】:2011-08-27 11:01:35
【问题描述】:
我有连接 SqlDataSource 的 GridView,我想在 OnRowUpdating 事件中我的条件为假时取消更新行?怎么做?谢谢。
【问题讨论】:
-
什么条件是假的?
我有连接 SqlDataSource 的 GridView,我想在 OnRowUpdating 事件中我的条件为假时取消更新行?怎么做?谢谢。
【问题讨论】:
试试
protected void Page_Load(object sender, EventArgs e)
{
GridView1.RowUpdating += new GridViewUpdateEventHandler(GridView1_RowUpdating);
}
void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
e.Cancel = true;
}
【讨论】: