I would like my users to be able to sort the datagrid by column heading. However, the Columns do not allow me to sort if I do not auto generate the columns. what is the work around for this or am I missing something.
I am showing the header
I have allow sorting checked
Here is the asp
<TT>
<asp:datagrid id="dgWO" runat="server" GridLines="Vertical" CellPadding="3" BackColor="White" BorderWidth="1px" BorderStyle="None" BorderColor="#999999" AllowSorting="True" OnSortCommand="dgWO_Sort" AutoGenerateColumns="False">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></SelectedItemStyle>
<AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
<ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#000084"></HeaderStyle>
<FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="WorkOrderID" DataNavigateUrlFormatString="ViewRequest.aspx?ID={0}" DataTextField="WorkOrderID" HeaderText="Work Order" NavigateUrl="ViewDubRequest.aspx">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:HyperLinkColumn>
<asp:BoundColumn DataField="Status" HeaderText="Status"></asp:BoundColumn>
<asp:BoundColumn DataField="DueDate" HeaderText="Due Date"></asp:BoundColumn>
<asp:BoundColumn DataField="Title" HeaderText="Title"></asp:BoundColumn>
<asp:BoundColumn DataField="TapeNumber" HeaderText="Tape Number"></asp:BoundColumn>
<asp:BoundColumn DataField="DisplayName" HeaderText="Requested By"></asp:BoundColumn>
<asp:ButtonColumn Text="Delete" CommandName="Delete"></asp:ButtonColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" Mode="NumericPages"></PagerStyle>
</asp:datagrid>
</TT>
Jason Meckley
Database Analyst
WITF
I am showing the header
I have allow sorting checked
Here is the asp
<TT>
<asp:datagrid id="dgWO" runat="server" GridLines="Vertical" CellPadding="3" BackColor="White" BorderWidth="1px" BorderStyle="None" BorderColor="#999999" AllowSorting="True" OnSortCommand="dgWO_Sort" AutoGenerateColumns="False">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></SelectedItemStyle>
<AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
<ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#000084"></HeaderStyle>
<FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="WorkOrderID" DataNavigateUrlFormatString="ViewRequest.aspx?ID={0}" DataTextField="WorkOrderID" HeaderText="Work Order" NavigateUrl="ViewDubRequest.aspx">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:HyperLinkColumn>
<asp:BoundColumn DataField="Status" HeaderText="Status"></asp:BoundColumn>
<asp:BoundColumn DataField="DueDate" HeaderText="Due Date"></asp:BoundColumn>
<asp:BoundColumn DataField="Title" HeaderText="Title"></asp:BoundColumn>
<asp:BoundColumn DataField="TapeNumber" HeaderText="Tape Number"></asp:BoundColumn>
<asp:BoundColumn DataField="DisplayName" HeaderText="Requested By"></asp:BoundColumn>
<asp:ButtonColumn Text="Delete" CommandName="Delete"></asp:ButtonColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" Mode="NumericPages"></PagerStyle>
</asp:datagrid>
</TT>
Jason Meckley
Database Analyst
WITF