I'm trying to rebound my data and refresh my grid after ajax
postback but my grid won't refresh , also I have some replacement in grids row data bound , and actually that replacement wont occur , any idea how to fix it ?
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();
}
note : I've trace these functions and they are actually working but the result won't show up .
more info : in this page i have a method that open a telerik radwindow as pop up and in that popup i`m updating one record in DB and after closing popup i want to refresh my grid and show a labal instead of my button in gridview