开发者

ASP.NET GridView how to cancel update

开发者 https://www.devze.com 2023-03-30 23:23 出处:网络
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

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;
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消