I'd like to add a List<Tuple<T1,T2>>
as DataSource
for my GridView
.
"Then do it!"
Yeah, that's not really the problem, the problem is accessing the values inside the GridView.
Here's my Code:
List<Tuple<Group, string>> userGroups = Util.PrepareGroups((string[][])Session["userGroups"]);
gridGroups.DataSource = userGroups;
gridGroups.DataBind();
Throws an exception at DataBind
, telling me that Item1.Name doesn't exist, speaking of this, here's my markup:
<asp:GridView runat="server" ID="gridGroups" CssClass="grid gridGroups" AutoGenerateColumns="false">
<Columns>
<asp:BoundField meta:resourcekey="gridGroupsName" DataField="Item1.Name" />
<asp:BoundField meta:resourcekey="gridGroupsFunction" DataField="Item2" />
</Columns>
</asp:GridView>
Needless to say, Item1
is the Group and Name
is a string
-Property.
He (yes, he, my IDE is called Bob) obviously doesn't find Item1.Name, is there any way to escape the .
?
Thanks,
Dennis