GW1 gets data from a stored procedure with SQL like "Select SortOrder, F1, F2 From Table1 Order By SortOrder;".
Question: How can I force this gridview to display per SortOrder field?
The field [SortOrder] will not displayed on the GW1. There is no need for additional sort after the page is displayed.
Sort order remains frozen
.; I am using Visual Studio 2010, c#.
I wonder something like this could be salvaged to do the job:
protected void gvItems_Sorting(object sender, GridViewSortEventArgs e)
GridView gv = (GridView)sender;
SqlDataSource ds = (SqlDataSource)gv.DataSource;
ds.SelectCommand = ds.SelectCommand + " order by "
+ e.SortExpression + " ASC ";
gvItems.DataSource = ds;
' not sure how to tailor this to work with my application. I got this from: stackoverflow.com/question