Grid Model With Dictionary or List

2 posts, 0 answers
  1. Justin
    Justin avatar
    17 posts
    Member since:
    May 2012

    Posted 03 May 2013 Link to this post

    My grid model is essentially a collection of dynamic fields that is stored in a Dictonary<string,Values> where Values has a couple properties on it. What would be the best way to iterate thru those values and display them as grid columns? Values will have a value and header text property. I have been searching the forums but have not found anything similar yet.

    thanks
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 07 May 2013 Link to this post

    Hello Justin,

    I am not sure if I understand your scenario completely. However the main issue that you need to solve when you do not have specific model is to define the columns of you Grid - this is usually solved by looping through the dynamic collection which holds the information about the columns and defining them through the string overload of the columns builder.

    here is a really simple scenario using a for loop:

    .Columns(columns =>
    {
        for (int i = 0; i < 23; i++)
        {
            columns.Bound("CustomColumn"+i);
        }


    Make sure that you have checked our code libraries which might show similar setup to what you need.

    Kind Regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top