I am attempting to pull from a SQL Server database using the strongly typed datasource generated by CodeSmith. Paging is working correctly, however I cannot seem to get sorting to work.
Thanks in advance,
jeremiah
Here is the code in question:
<cc1:DistrictDataSource ID="DistrictDataSource1" EnablePaging="true" runat="server" EnableSorting="True" Sort="DistrictName">
<Parameters>
<asp:ControlParameter Name="PageIndex" ControlID="EntityGridView1" PropertyName="PageIndex" Type="Int32" />
<cc1:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
<cc1:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
</Parameters>
<DeepLoadProperties Method="IncludeChildren" Recursive="False">
</DeepLoadProperties>
</cc1:DistrictDataSource>
<cc2:EntityGridView
ID="EntityGridView1"
runat="server"
AutoGenerateColumns="False"
DataSourceID="DistrictDataSource1"
DataKeyNames="DistrictID"
AllowMultiColumnSorting="False"
AllowPaging="True"
AllowSorting="True"
EnableViewState="False" PageSize="20"
AllowExportToExcel="False"
DefaultSortColumnName="DistrictName"
DefaultSortDirection="Ascending"
ExportToExcelText="Excel"
PageSelectorPageSizeInterval="10"
EnableTheming="False">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="DistrictID" DataNavigateUrlFormatString="../District/BuildingList.aspx?DistrictID={0}"
DataTextField="DistrictName" HeaderText="District" SortExpression="DistrictName" />
<asp:BoundField DataField="DistrictID" HeaderText="DistrictID" ReadOnly="True" SortExpression="DistrictID"
Visible="False" />
</Columns>
</cc2:EntityGridView>