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

Row and Columns

1 Answer 11 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Márcio Fábio Althmann
Top achievements
Rank 1
Márcio Fábio Althmann asked on 18 Feb 2010, 01:28 PM
Hello again :)
Imagining that I have a Customer class, and the client has a List <> with the days he was in the store, can I create a line for each client and the columns by the List <>?

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 18 Feb 2010, 01:50 PM
Hello Márcio Fábio Althmann,

What will happen if you have two customers? One will have days {1, 2, 3} and the other {4, 5, 6}. What columns will you create?

In general you can add columns to RadGridView programmatically through its Columns collection. When you create the columns you can bind them to anything that you want. So you have absolute freedom to add any columns that you wish. As long as the data item class has these properties defined.

But in my opinion the better approach here would be to normalize (i.e. transform) the data you have to something regular and then pass the already prepared data to RadGridView. You can build a DataTable on the fly for example. The data table will have all the columns and rows that you think it should have. This will save you a lot of trouble.

I hope this helps.

Regards,
Ross
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Márcio Fábio Althmann
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or