wpf-120191-controls-and-libraries-data-grid-bind-to-data-bind-to-any-data-source-with-virtual-sources-virtual-source-limitations.md
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 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 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:
Tip
Refer to the Add Filtering topic to learn more.
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 are disabled.
To show summaries:
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 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.
<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);
});
}
Private Sub TableView_ValidateRow(ByVal sender As Object, ByVal e As GridRowValidationEventArgs)
e.UpdateRowResult = Task.Run(Function()
IssuesService.UpdateRow(TryCast(e.Row, IssueData))
End Function)
End Sub
Binding property specified.If you have to calculate values on server by several columns, specify custom PropertyDescriptor s using the VirtualSourceBase.CustomProperties property.