Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have data like below:
List<obj> = {
obj1 prop1,
obj2 prop1,
obj3 prop1,

obj1 prop2,
obj2 prop2,

obj2 prop3,
obj3 prop3,

obj1 prop4,
obj2 prop4,}

But in UI I have to display above like this :

prop1 obj1 obj2 obj3
prop2 obj1 obj2 -
prop3 - obj2 obj3
prop4 obj1 - obj3

In short number of rows will be dependent on number of properties and number of columns on number of properties.
I tried to use Dictionary. But it does not fulfill my all scenarios.

Thanks in advance.
Posted
Comments
Richard MacCutchan 13-Jan-15 13:09pm    
Create a class of objects that can hold all the properties. you can then make a List that contains your objects.
Sergey Alexandrovich Kryukov 13-Jan-15 19:02pm    
What does it mean, "tabular format data"? Aren't you to store the data itself? Structure — based on what (in memory, some file, XML file, database...)?
—SA

1 solution

AS Richard suggests, a class to contain the properties is a very good way to go, and teh route I'd take.
The other suggestion would be to use a DataTable[^] - tabular data is exactly what they were designed for...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900