Is there a way to refresh the grid from javascript? I have a jquery dialog and once the user has added the new record then it close teh dialog and refresh the grid.. how can i refresh teh grid programatically?
I dont have the code here with me but its something along the lines of:
Javascript:
function UpdateGrid(id) { var grid = $("GridName").data("tGrid"); grid.rebind({ PerameterNameToPass: id });
}
There does seem to be a bug with telerik's new release when you manually rebind it. If you try to then sort/update/page the grid it will revert back to the default value. This is NOT how the last release worked. It seems to loose the new value you pass it. The only way I have found as a work around right now is storing the value in a session variable.
EG:
Inside the action:
if (Id != 0 || Session["SelectedID"] == null) { Session["SelectedID"] = Id; } else { Id = Int32.Parse(Session["SelectedID"].ToString()); }
Then use this to gather your results.
Hope this helps. And hopefully the bug will be sorted soon .... Its actually led to us stopping using the grids and probably moving away from Telerik.
I'd like to rebind programmatically too, but your snippet doesn't work for me
$("GridName") it's ok
but .data("tGrid") is undefined -> what is the meaning of data() parameter?