I'm creating an anonymous List<> here:
var pip = new { MCP = "", Measure = "", Year = "", url1 = "", url2 = "", url3 = "" };
var PipList = (new[] { pip }).ToList();
The I loop through my code and load that list with items and bind it to my gridview:
PipList.RemoveAt(0);
gvReport.DataSource = PipList;
gvReport.DataBind();
When I debug this I see that the List<> has items in it right before I bind it, but when I view the gridview after the bind it's empty. Is it not possible to do this?
I've also tried defining a class and not using an anonymous object and it doesn't work either.
If it helps this is the gridview
<asp:GridView ID="gvReport" Width="750" AutoGenerateColumns="false" runat="server"
AllowSorting="false" AllowPaging="false" CellPadding="4" GridLines="Both"
CssClass="gv_Style" Visible="false">
<HeaderStyle BackColor="#000000" ForeColor="White" />
<AlternatingRowStyle CssClass="gv_AlternatingRow" />
<RowStyle CssClass="gv_Row" />
<PagerStyle CssClass="gv_Pager" />
<Columns>
<asp:BoundField HeaderStyle-HorizontalAlign="Center" DataField="MCP" HeaderText="MCP" />
<asp:BoundField HeaderStyle-HorizontalAlign="Center" HeaderText="PIP Measure" DataField="Measure" />
<asp:BoundField HeaderStyle-HorizontalAlign="Center" HeaderText="Start Year" DataField="Year" />
<asp:BoundField HeaderStyle-HorizontalAlign="Center" HeaderText="Summary" DataField="url1" htmlencode="false" />
<asp:BoundField HeaderStyle-HorizontalAlign="Center" HeaderText="Detail" DataField="url2" htmlencode="false" />
<asp:BoundField HeaderStyle-HorizontalAlign="Center" DataField="url3" htmlencode="false" HeaderText="Yearly Summary" />
</Columns>
</asp:GridView>