I have the following gridview:
<asp:GridView ID="gvTimeline" ShowHeader="true" runat="server" ShowHeaderWhenEmpty="true" AutoGenerateColumns="false" >
<Columns>
<asp:BoundField DataField="8" ItemStyle-Width="25%" DataFormatString="{0:dd-MM-yyyy}" />
<asp:BoundField DataField="2" ItemStyle-Width="25%" DataFormatString="{0:dd-MM-yyyy}" />
<asp:BoundField DataField="6" ItemStyle-Width="25%" DataFormatString="{0:dd-MM-yyyy}" />
<asp:BoundField DataField="4" ItemStyle-Width="25%" DataFormatString="{0:dd-MM-yyyy}" />
</Columns>
</asp:GridView>
And the following sql table:
Id | type | date
2 | 8 | 22/09/1997
1 | 6 | 22/09/1998
3 | 4 | 22/09/1999
What I want is to run the sql rows and go filling each column with the date corresponding to the type (only 1 row). Each datafield is a type. What is the best way to do this, later getting access to each id normally?
I expected this:
8 2 6 4
22/09/1997 null 22/09/1998 22/09/1999