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

Binding Dictionary in column

2 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Al asked on 19 Sep 2011, 10:00 PM
Hi,

I need your help again, i have this object

public class Entry
{
     public string Company {get;set;}
     public Dictionary<Attribute,AttributeValue> Attributes {get;set;}
}
 
public class Attribute
{
     public int AttributeId {get;set;}
     public string AttributeName {get;set;}
}
 
 
public class AttributeValue
{
     public int Id {get;set;}
     public string ValueName {get;set;}
}

And what i want to do is to bind to a radgrid, so i can have this :

Company     |   AttributeName_1      |   AttributeName_2  |  ...... |  AttributeName_N
---------------------------------------------------------------------------------------------------
Company     |       ValueName        |   ValueName          | ........ |  ValueName     

I'm sure that this is possible, but i've been trying lots of ways, but still got no luck.

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Al
Top achievements
Rank 1
answered on 20 Sep 2011, 04:26 PM
No one can help me out with this kind of case ?
0
Iana Tsolova
Telerik team
answered on 23 Sep 2011, 11:47 AM
Hello Al,

This cannot be achieved automatically. If you want the grid to have the specified columns, you should flatten the datasource. You can build a level above this class and make it return the dictionary keys are simple properties with the respective values.

Best wishes,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Al
Top achievements
Rank 1
Answers by
Al
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or