I've been searching the documentation and the forum for a while for this, but haven't been able to find any solid information...
I have an object which contains some fields and a dictionary - I want to bind each value in the dictionary to a column in a radgrid. I don't know what these keys/values will be until the item comes back, and they'll change depending on the source of the query.
I can create the columns dynamically without a problem, but I need a way to bind their DataMember to the dictionary...what's the best way to achiever this?
I have an object which contains some fields and a dictionary - I want to bind each value in the dictionary to a column in a radgrid. I don't know what these keys/values will be until the item comes back, and they'll change depending on the source of the query.
I can create the columns dynamically without a problem, but I need a way to bind their DataMember to the dictionary...what's the best way to achiever this?
class
ItemQueryData
{
public
int
ItemId {
get
;
set
; }
public
String SomeProperty {
get
;
set
; }
public
Dictionary<
int
, Object> Values;
}
private
void
AddRefColumns()
{
foreach
(KeyValuePair<
int
, String> f
in
HeaderColumns)
_grid.Columns.Add(
new
GridBoundColumn() { DataField =
"Values["
+ f.Key +
"]"
, HeaderText = f.Value });
}