or
<telerik:RadEditor Skin="Default" ID="RadEditor1" EditModes="Preview" OnClientModeChange="OnClientModeChange" Enabled="true" runat="server" Width="100%" Height="150px" ToolsFile="~/includes/NoTools.xml"></telerik:RadEditor>function OnClientModeChange(editor, args) { var mode = editor.get_mode(); switch (mode) { case 1: //alert( "We are in Design mode"); //do something break; case 2: //alert("We are in HTML mode"); break; case 4: setTimeout(function () { var tool = editor.getToolByName("ToggleScreenMode"); tool.setState(0); }, 0); //alert( "We are in Preview mode"); //do something break; } }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>