Share via


DomainDataSource.LoadSize Property

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Gets or sets the maximum number of items to load each time a Load is executed. When equal to 0, all requested entities will be loaded.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)

Syntax

'Declaration
Public Property LoadSize As Integer
    Get
    Set
'Usage
Dim instance As DomainDataSource
Dim value As Integer

value = instance.LoadSize

instance.LoadSize = value
public int LoadSize { get; set; }
public:
property int LoadSize {
    int get ();
    void set (int value);
}
member LoadSize : int with get, set
function get LoadSize () : int
function set LoadSize (value : int)

Property Value

Type: System.Int32
The number of items to load in a single data loading operation, or 0 to indicate all items should be loaded.

Remarks

When PageSize and LoadSize are both non-zero, entities will be loaded using the multiple of PageSize nearest LoadSize. This allows multiple pages to be loaded at once without loading partial pages.

Always specify a value for LoadSize that is less than or equal to any ResultLimit property configured on the DomainDataSource.

Examples

The following example shows a DomainDataSource control with the LoadSize property set to 30 and PageSize property set to 15.

<Grid x:Name="LayoutRoot" Background="White">  
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <riaControls:DomainDataSource PageSize="15" LoadSize="30" x:Name="source" QueryName="GetProducts" AutoLoad="true">
        <riaControls:DomainDataSource.DomainContext>
            <domain:ProductDomainContext />
        </riaControls:DomainDataSource.DomainContext>
        <riaControls:DomainDataSource.SortDescriptors>
            <riaData:SortDescriptor PropertyPath="ListPrice" />
        </riaControls:DomainDataSource.SortDescriptors>
    </riaControls:DomainDataSource>
    <data:DataGrid Grid.Row="0" ItemsSource="{Binding Data, ElementName=source}" />
    <data:DataPager Grid.Row="1" Source="{Binding Data, ElementName=source}" />
</Grid>

See Also

Reference

DomainDataSource Class

System.Windows.Controls Namespace

LoadInterval

PageSize

Other Resources

DomainDataSource