GridView contents don’t update when underlying data changes

后端 未结 2 1502
礼貌的吻别
礼貌的吻别 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:50

    on page load:

    YourGridViewID.DataBind()
    
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题