I use asp.net 4 c#.
I have a gridview, inside a Label. I would like to know how to BIND the Text
property for the first label to the dictionary KEY and the second to dictionary VALUE, without using the gridview event DataBound
or similar.
Please suggest an example, thanks
<asp:GridView ID="uxContentByYearMonths" runat="server">
<Columns>
<asp:TemplateField HeaderText="Month">
<ItemTemplate>
<asp:Label ID="uxMonth" runat="server" Text='<%# Bind("Key") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total Content">
<ItemTemplate>
<asp:Label ID="uxCount" runat="server" Text='<%# Bind("Value") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
// DataSource
Dictionary<int, int> result = new Dictionary<int, int>();