R
Ryan Liu
Hi,
I try to use
list of XElements,
or
Array of XAttributes
or just list of Dictionary<stiring, string>
as data source to a <asp:GridView>
Then I found out I can not use <asp:BoundField> to simple display them.
Then I use Templated Fields, it works.
<SR:TemplateField HeaderText="Client"
SortExpression="Client">
<ItemTemplate>
<%# ((Dictionary<string,
string>)Container.DataItem)["Client"]%>
</ItemTemplate>
</SR:TemplateField>
I was wonder, all of above support kind of list.Item["Key"] , why not
Microsoft make it bindable? Why only limit to bind to public Property. (Here
"Client" is Dictionary entry Key, Xml Attribute name, or sub XElement
name).
Just like Javascript, we can access a.Key or a["Key"]. I think it will be
simplified things.
Or is there other better way?
Thanks!
I try to use
list of XElements,
or
Array of XAttributes
or just list of Dictionary<stiring, string>
as data source to a <asp:GridView>
Then I found out I can not use <asp:BoundField> to simple display them.
Then I use Templated Fields, it works.
<SR:TemplateField HeaderText="Client"
SortExpression="Client">
<ItemTemplate>
<%# ((Dictionary<string,
string>)Container.DataItem)["Client"]%>
</ItemTemplate>
</SR:TemplateField>
I was wonder, all of above support kind of list.Item["Key"] , why not
Microsoft make it bindable? Why only limit to bind to public Property. (Here
"Client" is Dictionary entry Key, Xml Attribute name, or sub XElement
name).
Just like Javascript, we can access a.Key or a["Key"]. I think it will be
simplified things.
Or is there other better way?
Thanks!