To populate a grid, I call an asmx web service and get back the following JSON string from the JavaScript deserializer:
[{"CustomerId":"ALFKI","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":"","PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"}]
This is grid which is consuming the data:
<telerik:RadGrid ID="GridCustomers"
runat="server"
AllowFilteringByColumn="true"
GridLines="None"
AllowPaging="true"
AllowSorting="true">
<ClientSettings>
<DataBinding Location="http://localhost/Niit/CustomerServices.asmx"
EnableCaching="true"
SortParameterType="Linq"
SelectMethod="GetCustomers"
SelectCountMethod="GetCount">
<DataService TableName="Customers" />
</DataBinding>
</ClientSettings>
<MasterTableView>
<Columns>
<telerik:GridBoundColumn SortExpression="CustomerId" DataField="CustomerId" HeaderText="Customer ID" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
At run time, I get an exception in the Telerik JavaScript file when this line of code is executed:
var x=this._dataSource[y][t]; // this line appears before "function U()"
This is the value of this._dataSource in the watch window:
this._dataSource = "[{"CustomerId":"ALFKI","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":"","PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"}";
Any ideas as to why I'm getting this exception?
Thanks in advance.