Skip to main content

LinqServerModeDataSource.Selecting Event

Enables you to provide a custom data source.

Namespace: DevExpress.Data.Linq

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public event EventHandler<LinqServerModeDataSourceSelectEventArgs> Selecting

Event Data

The Selecting event's data class is LinqServerModeDataSourceSelectEventArgs. The following properties provide information specific to this event:

Property Description
DefaultSorting Specifies how data source contents are sorted by default, when sort order is not specified by the bound control.
KeyExpression Gets or sets the key expression.
QueryableSource Gets or sets the queryable data source.


The Selecting event is raised before data is retrieved from a data source, and allows you to provide a custom data source. The custom data source is specified by the LinqServerModeDataSourceSelectEventArgs.QueryableSource property. In this instance, you should also specify the name of the key property using the LinqServerModeDataSourceSelectEventArgs.KeyExpression property.

protected void LinqServerModeDataSource1_Selecting(object sender, LinqServerModeDataSourceSelectEventArgs e) {
    e.QueryableSource = new NorhtwingDataContext().ProductsCostingMoreThan(80.5);
    e.KeyExpression = "ProductID";
See Also