Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 网格视图赢得';t刷新_C#_Asp.net_Ajax_Gridview - Fatal编程技术网

C# 网格视图赢得';t刷新

C# 网格视图赢得';t刷新,c#,asp.net,ajax,gridview,C#,Asp.net,Ajax,Gridview,我试图在ajaxpostback之后恢复数据并刷新我的网格,但是我的网格不会刷新,而且我在网格行数据绑定中有一些替换,事实上这种替换不会发生,你知道如何修复它吗 protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) { if (e.Argument == "Rebind") { int status = Convert.ToInt32(ViewState[

我试图在
ajax
postback之后恢复数据并刷新我的网格,但是我的网格不会刷新,而且我在网格行数据绑定中有一些替换,事实上这种替换不会发生,你知道如何修复它吗

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
    if (e.Argument == "Rebind")
    {
        int status = Convert.ToInt32(ViewState["status"]);
        BindGrid(status);
    }
}

protected void grdCheckOutList_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        Label lb = new Label();
        Button btn = (Button)e.Row.FindControl("btnSendMsg");
        DataRowView rowView = (DataRowView)e.Row.DataItem;
        if (!String.IsNullOrWhiteSpace(rowView[9].ToString()))
        {
            lb.Text = rowView[9].ToString();
            e.Row.Cells[6].Controls.Remove(btn);
            e.Row.Cells[6].Controls.Add(lb);
        }
    }
}

private void BindGrid(int status)
{
    ViewState.Add("status", status);
    grdCheckOutList.DataSource = business.GetListOFRequestByStatus(status);
    grdCheckOutList.EmptyDataText = "nothing found";
    grdCheckOutList.DataBind();
}
注意:我已经跟踪了这些函数,它们实际上正在工作,但结果不会显示出来


更多信息:在这个页面中,我有一个方法可以打开一个telerik radwindow作为弹出窗口,在弹出窗口中,我正在更新数据库中的一条记录,关闭弹出窗口后,我想刷新我的网格,并在gridview中显示一个labal而不是我的按钮,同时共享
BindGrid
方法,这将更有帮助。将你的BindGrid方法代码放在这里。我已经添加了绑定网格,有什么想法吗?