GridView contents don’t update when underlying data changes

后端 未结 2 1541
礼貌的吻别
礼貌的吻别 2021-01-23 04:09

So I have an ASP.NET page with two controls:

  • a GridView which displays rows from a SqlDataSource, and in which the user can select a row;
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-23 04:57

    If your OnItemUpdating event generates postback

    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            GridView.DataBind();//rebinding it with considering changes DetailView
        }
    }
    

    If it doesn't work let me know.

提交回复
热议问题