Hi
I am using the same method for binding data returned from json to the client side.
Please note that i am using this Grid in asp.net MVC 1.0. Script Manager and all other telerik objects are loading properly and i am receiving this JSON from a method which returns JSON. I hope that the given code is sufficient, however i can provide you MVC code, if required:
I am using the following code:
$.ajax({
type: "POST",
url: getAppPath() + "Account.aspx/UsersList",
data: { State: StateVal, County: CountyVal, District: DistrictVal, School: SchoolVal, sUserName: userName, sUserEmail: email, Status: StatusVal },
success: function(results) {
//alert(results);
updateGrid(results);
},
error: function(msg) {
alert("The following error occurred: " + msg.status + ": " + msg.statusText);
}
});
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function updateGrid(result) {
var tableView = $find("<%= grdUsers.ClientID %>").get_masterTableView();
tableView.set_dataSource(result);
tableView.dataBind();
}
function RadGrid1_Command(sender, args) {
var a = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
args.set_cancel(true);
alert("page command");
}
</script>
</telerik:RadCodeBlock>
When i call the updateGrid method
var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
the following line returns null. However if i only use this line, it will find the Grid.
var a = $find("<%= RadGrid1.ClientID %>")
Please let me know how to handle it and later assign the json to grid in order to populate it.
Thanks.
I am using the same method for binding data returned from json to the client side.
Please note that i am using this Grid in asp.net MVC 1.0. Script Manager and all other telerik objects are loading properly and i am receiving this JSON from a method which returns JSON. I hope that the given code is sufficient, however i can provide you MVC code, if required:
I am using the following code:
$.ajax({
type: "POST",
url: getAppPath() + "Account.aspx/UsersList",
data: { State: StateVal, County: CountyVal, District: DistrictVal, School: SchoolVal, sUserName: userName, sUserEmail: email, Status: StatusVal },
success: function(results) {
//alert(results);
updateGrid(results);
},
error: function(msg) {
alert("The following error occurred: " + msg.status + ": " + msg.statusText);
}
});
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function updateGrid(result) {
var tableView = $find("<%= grdUsers.ClientID %>").get_masterTableView();
tableView.set_dataSource(result);
tableView.dataBind();
}
function RadGrid1_Command(sender, args) {
var a = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
args.set_cancel(true);
alert("page command");
}
</script>
</telerik:RadCodeBlock>
When i call the updateGrid method
var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
the following line returns null. However if i only use this line, it will find the Grid.
var a = $find("<%= RadGrid1.ClientID %>")
Please let me know how to handle it and later assign the json to grid in order to populate it.
Thanks.