wpf-devexpress-dot-xpf-dot-data.md
A virtual source component that allows you to bind the GridControl to a data source and display data with infinite scrolling.
Namespace : DevExpress.Xpf.Data
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public sealed class InfiniteAsyncSource :
InfiniteSourceBase,
IEditableCollectionView
Public NotInheritable Class InfiniteAsyncSource
Inherits InfiniteSourceBase
Implements IEditableCollectionView
Run Demo: Infinite Scrolling Source
View Example: How to Bind to InfiniteAsyncSource
Read Tutorial: How to Use Virtual Sources Read Tutorial: How to Bind to a Custom Service with Restrictions
The InfiniteAsyncSource raises events in the UI Thread and uses tasks to process data in parallel Working Threads. You should provide tasks to these events to obtain summaries, rows, etc. and enable the UI Thread to get data you fetched.
You can maintain a clean MVVM pattern and specify operations above in a ViewModel. To do this, create a command and bind it to the corresponding property:
| Event | Property | Description |
|---|---|---|
| GetTotalSummaries | GetTotalSummariesCommand | Gets or sets a command that allows you to get total summaries. |
| FetchRows | FetchRowsCommand | Gets or sets a command that allows you to fetch rows. |
| GetUniqueValues | GetUniqueValuesCommand | Gets or sets a command that allows you to get unique values. |
The following code snippets (auto-collected from DevExpress Examples) contain references to the InfiniteAsyncSource class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
how-to-bind-wpf-grid-to-data/CS/ViewModel/EFCore/InfiniteAsyncSource/MainWindow.xaml#L17
<dxg:GridControl.ItemsSource>
<dx:InfiniteAsyncSource ElementType="local_issues:Issue" KeyProperty="Id"
FetchRowsCommand="{Binding FetchRowsCommand}" GetTotalSummariesCommand="{Binding GetTotalSummariesCommand}" />
wpf-data-grid-implement-crud-operations/CS/ViewModel/EFCore/InfiniteAsyncSource/MainWindow.xaml#L34
<dxg:GridControl.ItemsSource>
<dx:InfiniteAsyncSource ElementType="local_issues:Issue" KeyProperty="Id"
FetchRowsCommand="{Binding FetchRowsCommand}" GetTotalSummariesCommand="{Binding GetTotalSummariesCommand}" />
how-to-bind-to-grpc/CS/InfiniteAsyncSource.GRPC/MainWindow.xaml#L23
<dxg:GridControl.ItemsSource>
<dx:InfiniteAsyncSource ElementType="{x:Type issuesdata:Issue}"
FetchRowsCommand="{Binding FetchIssuesCommand}"
wpf-data-grid-bind-to-infiniteasyncsource/CS/InfiniteAsyncSourceMVVMSample/MainWindow.xaml#L21
<dxg:GridControl.ItemsSource>
<dx:InfiniteAsyncSource ElementType="{x:Type local:IssueData}"
FetchRowsCommand="{Binding FetchIssuesCommand}"
wpf-bind-gridcontrol-to-dynamic-data/CS/VirtualSources.InfiniteAsyncSource/MainWindow.xaml#L17
<dxg:GridControl.ItemsSource>
<dx:InfiniteAsyncSource CustomProperties="{Binding CustomFields}" FetchRowsCommand="{Binding FetchRowsCommand}" />
</dxg:GridControl.ItemsSource>
Object DispatcherObject DependencyObject ContentElement FrameworkContentElement DXFrameworkContentElement VirtualSourceBase InfiniteSourceBase InfiniteAsyncSource
See Also