0

This function gives error:

function RefreshGrid(){
    window.location.href="Form_ElameMamoreBazdid.aspx";
}
0

2 Answers 2

1

** Java Script **

function refreshGrid() {                   
    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();                  
}

** C# **

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{        
        Shomare_Darkhast = Convert.ToDecimal(Request.QueryString["Shomare_Darkhast"]);
        Grid_Bazdid.DataSource = Ent.ShowBazdid(Shomare_Darkhast);
        Grid_Bazdid.DataBind();

}
public ObjectQuery ShowBazdid(decimal Shomare_Darkhast)
{
   var List = from b in TBL_Bazdid
               where (b.Shomare_Darkhast == Shomare_Darkhast)
               join k in TBL_Karshenas on b.Code_Karshenas equals k.Code_Karshenas
               select new
               {
                   Radif = b.Radif,
                   Code_Karshenas = b.Code_Karshenas,
                   NameNameKhanevadegie_Karshenas = k.NameNameKhanevadegie_Karshenas,
                   Tarikh = b.Tarikh,
                   SaateShoro = b.SaateShoro,
               };
    return (ObjectQuery)List;
} 
Sign up to request clarification or add additional context in comments.

1 Comment

0
function RefreshGrid()
{
  var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
  masterTable.rebind();
}

Please take a look at above code.

By using client binding for the grid check out this help document!

3 Comments

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.
For that you must have to use advance data binding for radgrid, please check below link for this.demos.telerik.com/aspnet-ajax/grid/examples/programming/… You this get error because you assigned datakeynames in mastertableview/DetailTable which was not in assigned data source.
There is another way to refresh؟

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.