Is it possible to Bind Spreadsheet to IEnumerable<MyClass>

4 posts, 0 answers
  1. William
    William avatar
    5 posts
    Member since:
    Jan 2013

    Posted 29 Mar 2016 Link to this post

    Is it possible to bind the Spreadsheet to IEnumerable<MyClass> where the property names would be the columns of the sheet and each item of the IEnumerable object would be a row in the sheet? 

            public class MyClass
                public int Id { get; set; }
                public string FirstName { get; set; }
                public string LastName { get; set; }

            var myObject = new List<MyClass>()
               new MyClass() {Id = 1,FirstName = "Lucas",LastName = "Green"},
               new MyClass() {Id = 2,FirstName = "Eva",LastName = "Black"},
               new MyClass() {Id = 3,FirstName = "Miroslava",LastName = "Brown"},

    Id  FirstName   LastName
    1   Lukas          Green
    2   Eva             Black
    3   Miroslava    Brown

  2. Dimiter Topalov
    Dimiter Topalov avatar
    1274 posts

    Posted 01 Apr 2016 Link to this post

    Hello William,

    You can bind the Kendo UI Spreadsheet to a collection of a given type, using a DataSource. Currently there is no Razor syntax for a Spreadsheet DataSource configuration, but one is in production, and will be available in next week's service pack release.

    Meanwhile you can check out the following demo, showing how to bind a Spreadsheet to a dataDource:

    I hope this helps.

    Dimiter Topalov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Scott
    Scott avatar
    1 posts
    Member since:
    Oct 2013

    Posted 02 Aug 2016 in reply to Dimiter Topalov Link to this post

    Has the razor syntax for the spreadsheet DataSource configuration been released yet?    Running v.2016.1.112
  4. Dimiter Topalov
    Dimiter Topalov avatar
    1274 posts

    Posted 04 Aug 2016 Link to this post

    Hi Scott,

    It is released and available in our current official version (2016.2.714):

    The demo is also available in the sample application:

    Dimiter Topalov
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top