This is a migrated thread and some comments may be shown as answers.

[Solved] Grid DataSource & Web API

1 Answer 196 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 17 Oct 2014, 06:30 AM
I have a Web API that is being hosted on one server. The actual website using kendo is hosted on a different server. Looking at samples, for the grid I have to provide a model like this:

@(Html.Kendo().Grid(Something.Account)
.Name("grid")
...

However, the model is on the other server. I guess I could copy over the dll with the model but that does not sound like a good approach. Isn't there somehow a way to do this dynamically by accessing the WebApi, discover the columns and then render them or something like that, hence the model would not be required.

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 21 Oct 2014, 07:18 AM
Hi Rob,

Basically I would suggest to create new ViewModel in current project which to contain the needed fields that are returned from the WebApi.

Also it's possible to generate the Grid columns based on the received data, however it will require custom code and in this case you should use Kendo UI grid instead of the MVC wrappers. For convenience I created small example which demonstrates such setup:
Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Rob
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or