ListView for WPF | ComponentOne
Work with ListView / Virtualization
In This Topic
    Virtualization
    In This Topic

    Data Virtualization enables hassle-free loading of large amount of data. It enables the ListView to download only the required screen-display information instead of the whole data.

    virtualization in Listview

    C1ListView supports virtualization of data to fetch the list of items as the user scrolls in real time. This data virtualization technique is supported in ListView through C1DataCollection which provides C1VirtualDataCollection class for data virtualized collection views.

    <c1:C1ListView x:Name="listView" DisplayMemberPath="Name" SelectionMode="Single" Margin="10 0 10 10" Grid.Row="0" />
    
    public MainWindow()
    {
        InitializeComponent();
        //Bind to datasource
        this.Loaded += VirtualMode_Loaded;
    }
    // Use the LoadAsync method for data virtualization
    private async void VirtualMode_Loaded(object sender, RoutedEventArgs e)
    {
        var persons = new VirtualModeDataCollection();
        listView.ItemsSource = persons;
        await persons.LoadAsync(0, 0);
    }