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

Grid Model With Dictionary or List

1 Answer 248 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 03 May 2013, 02:58 PM
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

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 07 May 2013, 07:53 AM
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!
Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or