Hello.
Is RadClientDatasource supports OData with Web API?
I have one Web API controller derived from ApiController and another controller derived from ODataController. Both controller able to return data, I can see it in a browser.
I'm trying to bind a grid to each service using RadClientDatasource.
The grid which bound to regular Web API displays data with no problems.
But the grid bound to the OData service always empty. I have tried to use all DataTypes with OData - XML, JSON, JSONP - with no results.
The markup:
Thank you,
Denis Mitropolskiy
Is RadClientDatasource supports OData with Web API?
I have one Web API controller derived from ApiController and another controller derived from ODataController. Both controller able to return data, I can see it in a browser.
I'm trying to bind a grid to each service using RadClientDatasource.
The grid which bound to regular Web API displays data with no problems.
But the grid bound to the OData service always empty. I have tried to use all DataTypes with OData - XML, JSON, JSONP - with no results.
The markup:
01.
<
t:RadClientDataSource
runat
=
"server"
ID
=
"cdsWA"
>
02.
<
DataSource
>
03.
<
WebServiceDataSourceSettings
ServiceType
=
"Default"
>
04.
<
Select
Url
=
"http://localhost:52339/api/Tests"
DataType
=
"JSON"
/>
05.
</
WebServiceDataSourceSettings
>
06.
</
DataSource
>
07.
<
Schema
>
08.
<
Model
>
09.
<
t:ClientDataSourceModelField
FieldName
=
"Id"
DataType
=
"Number"
/>
10.
<
t:ClientDataSourceModelField
FieldName
=
"Text"
DataType
=
"String"
/>
11.
<
t:ClientDataSourceModelField
FieldName
=
"Number"
DataType
=
"Number"
/>
12.
</
Model
>
13.
</
Schema
>
14.
</
t:RadClientDataSource
>
15.
16.
<
t:RadClientDataSource
runat
=
"server"
ID
=
"cdsOD"
>
17.
<
DataSource
>
18.
<
WebServiceDataSourceSettings
ServiceType
=
"OData"
>
19.
<
Select
Url
=
"http://localhost:52339/odata/OTests"
DataType
=
"JSONP"
/>
20.
</
WebServiceDataSourceSettings
>
21.
</
DataSource
>
22.
<
Schema
>
23.
<
Model
>
24.
<
t:ClientDataSourceModelField
FieldName
=
"Id"
DataType
=
"Number"
/>
25.
<
t:ClientDataSourceModelField
FieldName
=
"Text"
DataType
=
"String"
/>
26.
<
t:ClientDataSourceModelField
FieldName
=
"Number"
DataType
=
"Number"
/>
27.
</
Model
>
28.
</
Schema
>
29.
</
t:RadClientDataSource
>
30.
31.
<
div
>GRID</
div
>
32.
<
t:RadGrid
runat
=
"server"
ID
=
"rgWebapi"
ClientDataSourceID
=
"cdsWA"
>
33.
<
MasterTableView
>
34.
<
Columns
>
35.
<
t:GridBoundColumn
DataField
=
"Id"
HeaderText
=
"ID"
></
t:GridBoundColumn
>
36.
<
t:GridBoundColumn
DataField
=
"Text"
HeaderText
=
"TEXT"
></
t:GridBoundColumn
>
37.
<
t:GridBoundColumn
DataField
=
"Number"
HeaderText
=
"NUMBER"
></
t:GridBoundColumn
>
38.
</
Columns
>
39.
</
MasterTableView
>
40.
</
t:RadGrid
>
41.
42.
<
t:RadGrid
runat
=
"server"
ID
=
"rgOData"
ClientDataSourceID
=
"cdsOD"
>
43.
<
MasterTableView
>
44.
<
Columns
>
45.
<
t:GridBoundColumn
DataField
=
"Id"
HeaderText
=
"ID"
></
t:GridBoundColumn
>
46.
<
t:GridBoundColumn
DataField
=
"Text"
HeaderText
=
"TEXT"
></
t:GridBoundColumn
>
47.
<
t:GridBoundColumn
DataField
=
"Number"
HeaderText
=
"NUMBER"
></
t:GridBoundColumn
>
48.
</
Columns
>
49.
</
MasterTableView
>
50.
</
t:RadGrid
>
Thank you,
Denis Mitropolskiy