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

Bind data AND template from JSON + WebAPI?

1 Answer 4 Views
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 23 Jul 2018, 09:56 PM

I have various different data sets that I get from one of my VB.NET WebAPI's. My WebAPI is a separate project that feeds a lot of JSON to another client-side project with my Grid.

I wanted to be able to have users select which data set they want to see, such as "Due Dates" or "Books" or "Memberships" and have each different option show a different RadGrid, while only ever including one RadGrid in my ASPX. I first thought to try UserControls, each with its own grid and binding logic, but I never got them working.

Is it possible for me to just have one RadGrid defined in my ASPX and then have it be fed data and how to display that data from my WebAPI on-demand? I would somehow need it to know how to size certain columns, how to have different item templates, how to have different sorting, etc. I effectively just don't want 10 different RadGrid controls on one page, and I want them all to be fed via my WebAPI and have as little code-behind in the grid's project as possible.

1 Answer, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 26 Jul 2018, 01:36 PM

Hi Alex,

If you get the Data as JSON and prefer working with it only on the client, the Kendo Grid seems like a better option: https://demos.telerik.com/kendo-ui/grid/index.

Then you can use the rowTemplates and create a custom appearance for the cells - https://demos.telerik.com/kendo-ui/grid/rowtemplate.

Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Share this question
or