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.

UIElement List

  • 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.

See Also

NIB: LinqDataSource Web Server Control Overview