Trying to bind the grid client-side. However, no data is displayed even though valid JSON is being passed into assignDataSOurce. Looks like it's dying on line 3 of the JS block (masterTable.set_dataSource(ds.d);).
1.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
Skin
=
"Metro"
2.
AutoGenerateColumns
=
"False"
ViewStateMode
=
"Disabled"
ShowHeader
=
"False"
>
3.
<
ClientSettings
>
4.
<
Selecting
AllowRowSelect
=
"True"
/>
5.
<
Resizing
AllowRowResize
=
"False"
ShowRowIndicatorColumn
=
"False"
AllowColumnResize
=
"True"
/>
6.
<
Scrolling
AllowScroll
=
"False"
/>
7.
<
ClientEvents
OnRowSelected
=
"RowSelectionChanged"
></
ClientEvents
>
8.
</
ClientSettings
>
01.
function assignDataSource(ds) {
02.
var masterTable = $("<%= RadGrid1.ClientID %>").get_masterTableView();
03.
masterTable.set_dataSource(ds.d);
04.
masterTable.dataBind();
05.
}
06.
07.
function GetData() {
08.
09.
10.
var searchObj;
11.
var searchMethod;
12.
13.
$.ajax({
14.
type: "POST",
15.
contentType: "application/json; charset=utf-8",
16.
url: "/WebServices/RwsSearch.svc/" + searchMethod,
17.
data: JSON.stringify(searchObj),
18.
dataType: "json",
19.
success: function (data, textStatus) {
20.
try {
21.
assignDataSource(data);
22.
23.
} catch (err) {
24.
//ConfirmOpen("Sorry, unable to search. " + err + " : " + textStatus);
25.
}
26.
},
27.
failure: function (errMsg, textStatus) {
28.
//ConfirmOpen(errMsg + " : " + textStatus);
29.
}
30.
});
31.
32.
}