Can't sort DataGrid

J

Joe

ello,

I have a datagrid in an nested html table (one table inside of another
table) and have set the allowsSorting property to true. I've created in the
code-behind a method (Sub - I'm using VB.NET) that handles the SortCommand
event of the data grid. I've included the declaration of the Sub below.
EnableViewState is set to false; we reload the DataSource each time the page
posts.

Would anyone know why this DataGrid doesn't sort? The web server isn't
executing the SortCommand event handler.

If tehre is any other information that I can offer, please elt me know.
This really has me stumped.

Sub Declaration:*********************************
Private Sub SortDataGridColumns(ByVal sender As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
dgForms.SortCommand

PopulateClaimFormsDataGrid(e.SortExpression,
SwapSortDirection(e.SortExpression))
End Sub
*********************************************

Data Grid HTML**********************************
<asp:datagrid id="dgForms" runat="server" CssClass="Interior"
AllowSorting="True" AutoGenerateColumns="False">
<AlternatingItemStyle
BackColor="GhostWhite"></AlternatingItemStyle> <ItemStyle
BackColor="Gainsboro"></ItemStyle>
<Columns>
<asp:HyperLinkColumn Target="_self"
DataNavigateUrlField="Form_Path_File_NM" DataTextField="Form_Number"
SortExpression="Form_Number" HeaderText="NUMBER">
<HeaderStyle Width="10%" CssClass="TableHeader"></HeaderStyle>
<ItemStyle CssClass="TableData"></ItemStyle>
</asp:HyperLinkColumn>
<asp:BoundColumn DataField="Form_Name" SortExpression="Form_Name"
HeaderText="NAME">
<HeaderStyle Width="50%" CssClass="TableHeader"></HeaderStyle>
<ItemStyle CssClass="TableData"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Description"
SortExpression="Description" HeaderText="CATEGORY">
<HeaderStyle Width="25%" CssClass="TableHeader"></HeaderStyle>
<ItemStyle CssClass="TableData"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Form_State_CD"
SortExpression="Form_State_CD" HeaderText="STATE">
<HeaderStyle Width="15%" CssClass="TableHeader"></HeaderStyle>
<ItemStyle CssClass="TableData"></ItemStyle>
</asp:BoundColumn>
</Columns>
</asp:datagrid>
*********************************************

TIA,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,829
Messages
2,569,737
Members
45,521
Latest member
maryb

Latest Threads

Top