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方法代码放在这里。我已经添加了绑定网格,有什么想法吗?