Data Binding to Large Data via LINQ
- 2 minutes to read
The ASPxCardView control allows you to bind to large data sets with the LinqServerModeDataSource component. This component fully supports database server mode (which delegates all data processing to the database server), and loads only records to be displayed on screen. This functionality dramatically increases the control's performance when working with large datasets.
Server mode can be enabled for any Language-Integrated Query (LINQ) provider. The LinqServerModeDataSource component is designed for ASP.NET applications, and serves as a data source for the ASPxCardView control.
When an end user performs data operations (sorting, filtering, etc.), the LinqServerModeDataSource component analyzes the grid's current state and generates smart queries that retrieve only records to be displayed on screen. These requests are passed to the associated LINQ Provider. The LINQ Provider translates them into the required queries and executes them.
The LinqServerModeDataSource component allows you to bind ASPxCardView to 'LINQ to SQL Classes' and enable server mode.
Create Data Classes
Add 'LINQ to SQL Classes'.
Data classes can then be created and edited in the Object Relational Designer (O/R Designer). The O/R Designer provides a visual design surface to create LINQ to SQL entity classes and relationships based on database objects. The O/R Designer currently supports only SQL Server 2000, SQL Server 2005, SQL Server 2008, and SQL Server Express databases.
You can drag database tables and views from Server Explorer/Database Explorer onto the O/R Designer to create entity classes, and map them to tables and views.
- Save your changes, close the O/R Designer, and rebuild the solution.
- Drag the LinqServerModeDataSource component and drop it onto the Page.
- Specify the type of objects retrieved from a data source, using the LinqServerModeDataSource.ContextTypeName property.
- Use the LinqServerModeDataSource.TableName property to specify the data table name.
- Bind the ASPxCardView control to the LinqServerModeDataSource component, and specify the grid's ASPxGridBase.KeyFieldName property.
Database Server Mode Limitations
In database server mode, ASPxCardView does not have simultaneous access to bound data in its entirety. This imposes some limitations on the grid's features, which are still available in regular binding mode. See the following help topic for information on features that are not supported in server mode: Database Server Mode Limitations.