Virtual Source Limitations
- 4 minutes to read
The GridControl bound to a virtual source only requests top records or a specific page. You can specify which data operations are supported to prevent end users from overloading the database with non-optimal queries. The GridControl hides the UI elements for non-supported operations.
Note
TreeListView is not supported.
Sorting
Sorting is disabled.
To enable sorting:
Fetch rows taking into account the GridControl‘s sorting using the FetchEventArgsBase.SortOrder property.
Set the ColumnBase.AllowSorting property to true to allow sorting by specific column (the DataViewBase.AllowSorting property is ignored).
Tip
Refer to the Add Sorting topic to learn more.
You can sort by single column only initially. Set the GridViewBase.AllowGroupingSortingBySingleColumnOnly property to false to allow sorting by multiple column.
Filtering
Filtering is disabled.
To enable filtering:
Fetch rows taking into account the GridControl‘s filtering using the FetchEventArgsBase.Filter property.
Use the following properties to specify filters that the GridControl‘s column supports:
Property Description ColumnBase.AllowedUnaryFilters Gets or sets unary filters that the GridControl‘s column supports. ColumnBase.AllowedBinaryFilters Gets or sets binary filters that the GridControl‘s column supports. ColumnBase.AllowedAnyOfFilters Gets or sets any of filters that the GridControl‘s column supports. ColumnBase.AllowedDateTimeFilters Gets or sets date-time filters that the GridControl‘s column supports. ColumnBase.AllowedBetweenFilters Gets or sets between filters that the GridControl‘s column supports. DataViewBase.AllowedGroupFilters Gets or sets group filters that the GridControl supports.
Tip
Refer to the Add Filtering topic to learn more.
Searching
Searching is disabled.
Tip
Refer to the Enable Search Panel topic to learn how to enable searching.
Note that virtual sources do not support text highlighting using the Search Panel. This element allows end users to iterate between found values by pressing F3
or the built-in navigation buttons, which may lead to loading of a huge amount of rows when using virtual sources.
Total Summaries
Total Summaries are disabled.
To show summaries:
- Handle the InfiniteAsyncSource.GetTotalSummaries event to get total summaries.
- Specify the total summaries that the GridControl should display using the GridControl.TotalSummary property.
Tip
Refer to the Add Summaries topic to learn more.
Use the ColumnBase.AllowedTotalSummaries and TableView.AllowCountTotalSummary properties to specify the allowed summary type and allow users to display summaries.
Note
Summaries for Selection are not supported.
Data Editing
Data Editing is disabled.
Virtual sources support editing only in Edit Entire Row mode:
Set the ColumnBase.AllowEditing property to true for the columns that users can edit.
Set the TableView.ShowUpdateRowButtons property to OnCellEditorOpen / OnCellValueChange to enable Edit Entire Row mode.
Handle the GridViewBase.ValidateRow event and save the changes to an underlying data source (database) synchronously or asynchronously.
To save the changes asynchronously, set the GridRowValidationEventArgs.UpdateRowResult property to a task that saves the changes.
<dxg:GridControl x:Name="grid">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Subject" IsSmart="True" AllowEditing="true"/>
<dxg:GridColumn FieldName="User" IsSmart="True" AllowEditing="true"/>
<dxg:GridColumn FieldName="Created" IsSmart="True" AllowEditing="true"/>
<dxg:GridColumn FieldName="Votes" IsSmart="True" AllowEditing="true"/>
<dxg:GridColumn FieldName="Priority" IsSmart="True" AllowEditing="true"/>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView ValidateRow="TableView_ValidateRow" ShowUpdateRowButtons="OnCellValueChange" />
</dxg:GridControl.View>
</dxg:GridControl>
private void TableView_ValidateRow(object sender, GridRowValidationEventArgs e) {
e.UpdateRowResult = Task.Run(() => {
IssuesService.UpdateRow(e.Row as IssueData);
});
}
Unbound Columns
- You can create an Unbound Column and use the Expression Editor to edit the ColumnBase.UnboundExpression property.
- You cannot apply data shaping operations (sorting, grouping, summaries) to the Unbound Column.
If you have to calculate values on server by several columns, specify custom PropertyDescriptors using the VirtualSourceBase.CustomProperties property.
Conditional Formatting
- You can use the FormatCondition conditional formats only.
Printing and Exporting
- In the PagedAsyncSource and PagedSource, the Printing and Exporting feature is not supported.
- In the InfiniteAsyncSource and InfiniteSource, the GridControl prints and exports loaded rows only. In Data-aware export summaries are calculated by loaded rows on the Excel side, and can be different from the GridControl‘s values.
Data Navigator
- You can use navigation buttons in the Data Navigator. The Remove, Add, Edit buttons are disabled.
Drag-and-Drop
- The Drag-and-Drop feature is disabled by default. You can handle custom events to implement custom drag-and-drop.
Selection
- In the InfiniteAsyncSource and InfiniteSource, the DataControlBase.SelectAll method is ignored, and the Web-style Row Selection feature does not work.
- In the PagedAsyncSource and PagedSource, the DataControlBase.SelectAll method selects rows within the current page only.
Best Fit
- In the InfiniteAsyncSource and InfiniteSource, the BestFitMode.AllRows mode works only for loaded rows.
- In the PagedAsyncSource and PagedSource, the BestFitMode.AllRows mode works only for the current page’s rows.