Isn't there a way to do something like this:
But build all the column headers and bind to data on the code-behind side?
I've been looking all over and can't find examples where people manually create the columns in the aspx.vb file.
KizMar
------------
Code:
<asp:GridView ID="myGridView" DataSourceID="mySqlDataSource" runat="server"
AutoGenerateColumns = "False"
AllowPaging = "True"
AllowSorting = "True"
DataKeyNames = "au_id"
CellPadding = "4"
ForeColor = "#333333"
GridLines = "None"
>
<Columns>
<asp:BoundField HeaderText="ID" DataField="au_id" SortExpression="au_id" ReadOnly="True" />
<asp:BoundField HeaderText="First Name" DataField="au_fname" SortExpression="au_fname" />
<asp:BoundField HeaderText="Last Name" DataField="au_lname" SortExpression="au_lname" />
<asp:BoundField HeaderText="Address" DataField="address" SortExpression="address" />
<asp:BoundField HeaderText="City" DataField="city" SortExpression="city" />
<asp:BoundField HeaderText="State" DataField="state" SortExpression="state" />
<asp:BoundField HeaderText="Zip Code" DataField="zip" SortExpression="zip" />
<asp:BoundField HeaderText="Phone" DataField="phone" SortExpression="phone" />
<asp:CheckBoxField HeaderText="Contract" DataField="contract" SortExpression="contract" />
<asp:CommandField
ButtonType = "Button"
ShowEditButton = "True"
ShowDeleteButton = "True"
/>
</Columns>
<HeaderStyle BackColor="#333399" ForeColor="#FFFFFF" Font-Bold="True" />
<RowStyle BackColor="#CCCCCC" />
<AlternatingRowStyle BackColor="#FFFFFF" />
<PagerStyle BackColor="#333399" ForeColor="#FFFFFF" HorizontalAlign="Center" />
</asp:GridView>
I've been looking all over and can't find examples where people manually create the columns in the aspx.vb file.
KizMar
------------