How to use an Generic Object list as a DataSource

2 posts, 1 answers
  1. Michael
    Michael avatar
    2 posts
    Member since:
    Jul 2015

    Posted 16 Sep 2015 Link to this post

    Hi all,

    I've seen all of the 4 episodes of the Getting Started with the Kendo UI for ASP.Net MVC, however I can't seem to figure out how to set up a DataSource with a Generic ObjectList.

    This is the piece of code I currently have:

    public JsonResult Get([DataSourceRequest] DataSourceRequest request)
                Runner runner = new Runner();
                Task<List<CustomOrder>> customOrderResult = Task.Run(async () => await runner.GetCustomOrders().ConfigureAwait(false));
                List<CustomOrder> customOrders = customOrderResult.Result;

    I know it ain't perfect. Going to refactor it as soon as I got it working properly.

    Thanks in advance for all your help.

  2. Answer
    Genady Sergeev
    Genady Sergeev avatar
    1595 posts

    Posted 18 Sep 2015 Link to this post

    Hi Michael,

    There are several demos that showcase how to bind the Grid on the server to a generic list. Consider the grid edit demo for example. Take a look at the EditController.cs class for details on the suggested implementation.

    Genady Sergeev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
Back to Top