Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Configure Order By Expression - LinqDataSource

The Configure Order By Expression dialog box enables you to define how the data from the LinqDataSource control is sorted. You can specify up to three properties that will be used to sort the results. For more information about how to sort the data from a LinqDataSource control, see the OrderBy property.

You access this dialog box by clicking Order By in the Configure Data Source - LinqDataSource dialog box when the AutoGenerateOrderByClause property is false. If you set the AutoGenerateOrderByClause property to true, the Order By button displays the Expression Editor dialog box. This is because you cannot set the Order By clause and also have the LinqDataSource control automatically create the Order By clause.

Sort by

Specifies the first property that is used to sort the results from the LINQ query. To reset the Order By expression to use no sorting, set this element to (None). This clears the Then by values also.

The default sort order is ascending. To change the sort order to descending, select the Descending option. This adds the keyword desc to the specified property in the resulting Order By expression.

Then by

Specifies the second and third properties to use to sort the results from the LINQ query.

Order By Expression

Displays the Order By expression as you set the Sort by and Then by elements.

Community Additions

ADD
Show:
© 2015 Microsoft