【问题标题】:ASP.NET GridView how to cancel updateASP.NET GridView 如何取消更新
【发布时间】:2011-08-27 11:01:35
【问题描述】:

我有连接 SqlDataSource 的 GridView,我想在 OnRowUpdating 事件中我的条件为假时取消更新行?怎么做?谢谢。

【问题讨论】:

  • 什么条件是假的?

标签: asp.net events gridview


【解决方案1】:

试试

protected void Page_Load(object sender, EventArgs e)
    {
        GridView1.RowUpdating += new GridViewUpdateEventHandler(GridView1_RowUpdating);
    }

    void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
          e.Cancel = true;
    }

【讨论】:

    猜你喜欢
    • 2010-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多