Xceed DataGrid for WPF v7.3 Documentation
Xceed.Wpf.DataGrid Assembly / Xceed.Wpf.DataGrid Namespace / DataGridVirtualizingQueryableCollectionViewSource Class
Members Example


    DataGridVirtualizingQueryableCollectionViewSource Class
    The DataGridVirtualizingQueryableCollectionView class and its XAML proxy, the DataGridVirtualizingQueryableCollectionViewSource class, provide support for IQueryable data sources.
    Syntax
    'Declaration
     
    <TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
    <NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
    Public Class DataGridVirtualizingQueryableCollectionViewSource 
       Inherits DataGridVirtualizingCollectionViewSourceBase
     
    Example
    The following example demonstrates how to bind to a data source that implements IQueryable (LINQ DataContext) and allow items to be edited, deleted, inserted, and refreshed.The following code provides the code-behind implementation of the CommitMode, CreatingNewItem, CommittingNewItem, CancelingNewItem, CommitItems, and RemovingItem events. The following code provides the code-behind implementation of the CommitMode, CreatingNewItem, CommittingNewItem, CancelingNewItem, CommitItems, and RemovingItem events.
    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
       <Grid.Resources>
    
    
         <xcdg:DataGridVirtualizingQueryableCollectionViewSource x:Key="cvs_queryableSource"
                                                                 QueryableSource="{Binding Path=QueryableSource}"
                                                                 CommitMode="EditCommitted"
                                                                 CreatingNewItem="DataGridVirtualizingQueryableCollectionViewSource_CreatingNewItem"
                                                                 CommittingNewItem="DataGridVirtualizingQueryableCollectionViewSource_CommittingNewItem"
                                                                 CancelingNewItem="DataGridVirtualizingQueryableCollectionViewSource_CancelingNewItem"
                                                                 CommitItems="DataGridVirtualizingQueryableCollectionViewSource_CommitItems"
                                                                 RemovingItem="DataGridVirtualizingQueryableCollectionViewSource_RemovingItem" />
       </Grid.Resources>
    
       <xcdg:DataGridControl ItemsSource="{Binding Source={StaticResource cvs_queryableSource}}"
                             ItemScrollingBehavior="Deferred"
                             MaxGroupLevels="2"
                             MaxSortLevels="2"
                             IsDeleteCommandEnabled="True"
                             IsRefreshCommandEnabled="True">
          <xcdg:DataGridControl.Resources>
    
             <Style TargetType="{x:Type xcdg:Row}"
                    x:Key="RowHeightStyle">
                <Setter Property="Height"
                        Value="27" />
             </Style>
    
             <Style TargetType="{x:Type xcdg:DataRow}"
                    BasedOn="{StaticResource RowHeightStyle}" />
             <Style TargetType="{x:Type xcdg:InsertionRow}"
                    BasedOn="{StaticResource RowHeightStyle}" />
          </xcdg:DataGridControl.Resources>
    
          <xcdg:DataGridControl.View>
             <xcdg:TableView>
                <xcdg:TableView.FixedHeaders>
                   <DataTemplate>
                      <xcdg:InsertionRow />
                   </DataTemplate>
                </xcdg:TableView.FixedHeaders>
             </xcdg:TableView>
          </xcdg:DataGridControl.View>
    
          <xcdg:DataGridControl.Columns>
             <xcdg:Column FieldName="ProductID"
                          AllowSort="False"
                          AllowGroup="False" />
          </xcdg:DataGridControl.Columns>
       </xcdg:DataGridControl>
    </Grid>
    Inheritance Hierarchy

    System.Object
       System.Windows.Threading.DispatcherObject
          System.Windows.DependencyObject
             System.Windows.Data.CollectionViewSource
                Xceed.Wpf.DataGrid.DataGridCollectionViewSourceBase
                   Xceed.Wpf.DataGrid.DataGridVirtualizingCollectionViewSourceBase
                      Xceed.Wpf.DataGrid.DataGridVirtualizingQueryableCollectionViewSource

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also