I have a GridView with AllowSorting="True", and I have an ObjectDataSource with SortParameterName="orderBy" ,SelectMethod="GetScheduledSurveys" and
<SelectParameters>
<asp:Parameter Name="orderBy" Type="String" DefaultValue="SurveyDueDate" />
</SelectParameters>
When I first go to the page, the DefaultValue for the “orderBy” SelectParameter is not passed to the “GetScheduledSurveys” SelectMethod. It is only passed in when I click on a heading in the GridView. How do I get it to use the default on first access?
Is there a reason why you don’t have this data sorted before you pass it to your datasource (i.e. sort it on your stored procedure, or query)? If not I would suggest to do it on
Page_LoadwhenPage.IsPostBack==false. Good luck!