I am trying to rebind my RadGrid after I have performd some actions below is my ajax code that does some operations in server side:
var id = $(this).find("input[name$=hiddenID]").val();
$.ajax({
type: "POST",
url: "Details.aspx/DoStuff",
data: "{'id': '" + id + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
if (msg.d == 'Sent') {
$.colorbox({ href: '/view.aspx?Id=' + id, iframe: true,});
GridRebind();
}
}
});
To rebind on success I have got this javascript code:
function GridRebind() {
var masterTable = $find("<%= gd.ClientID %>").get_masterTableView();
masterTable.rebind();
}
But everytime I get $find(..)is null
on var masterTable = $find("<%= gd.ClientID %>").get_masterTableView();
and it doesn't rebind the grid.
When researching I found out you need to put the following in Grid and set Grid datasource to something on page Init but still not working :
<ClientSettings>
<ClientEvents OnCommand="function(){}" />
</ClientSettings>