Back to Devexpress

LinqServerModeDataSource.Selecting Event

aspnet-devexpress-dot-data-dot-linq-dot-linqservermodedatasource.md

latest2.5 KB
Original Source

LinqServerModeDataSource.Selecting Event

Enables you to provide a custom data source.

Namespace : DevExpress.Data.Linq

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public event EventHandler<LinqServerModeDataSourceSelectEventArgs> Selecting
vb
Public Event Selecting As EventHandler(Of LinqServerModeDataSourceSelectEventArgs)

Event Data

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

PropertyDescription
DefaultSortingSpecifies how data source contents are sorted by default, when sort order is not specified by the bound control.
KeyExpressionGets or sets the key expression.
QueryableSourceGets or sets the queryable data source.

Remarks

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.

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

See Also

LinqServerModeDataSource Class

LinqServerModeDataSource Members

DevExpress.Data.Linq Namespace