Bind data AND template from JSON + WebAPI?

2 posts, 0 answers
  1. Alex
    Alex avatar
    23 posts
    Member since:
    Nov 2013

    Posted 23 Jul 2018 Link to this post

    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.

  2. Peter
    Peter avatar
    13 posts
    Member since:
    May 2016

    Posted 26 Jul 2018 Link to this post

    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.

Back to Top