Back to Devexpress

CompatibilitySettings.AllowInfiniteGridSize Property

corelibraries-devexpress-dot-xpf-dot-core-dot-compatibilitysettings-46e55fc1.md

latest2.4 KB
Original Source

CompatibilitySettings.AllowInfiniteGridSize Property

Gets or sets whether to allow infinite size of the grid-based control (for example, GridControl, TreeListControl).

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Data.Desktop.v25.2.dll

NuGet Packages : DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design

Declaration

csharp
public static bool AllowInfiniteGridSize { get; set; }
vb
Public Shared Property AllowInfiniteGridSize As Boolean

Property Value

TypeDescription
Boolean

true to allow a control to have an infinite size; otherwise, false.

|

Remarks

The AllowInfiniteGridSize property specifies whether the grid can have an infinite height and/or width.

Default Behavior

The AllowInfiniteGridSize setting is disabled.

When a grid is placed in a container without a defined size constraint, the grid throws the InfiniteGridSizeException to prevent performance issues caused by rendering all grid rows.

How to Avoid the Exception

Limit the Grid’s HeightPlace the grid in a container (for example, Grid or DockPanel) that assigns a finite size to it.Set Height or MaxHeightExplicitly set the grid’s size or maximum allowed size (for example, Height or MaxHeight).

Allow Infinite Height

Enable the AllowInfiniteGridSize setting at application startup:

csharp
public partial class App : Application {
    static App() {
        // Allow the grid to have an infinite height (not recommended for large datasets)
        DevExpress.Xpf.Core.CompatibilitySettings.AllowInfiniteGridSize = true;
    }
}

Important

Be aware of the potential impact on performance when binding to large datasets.

See Also

CompatibilitySettings Class

CompatibilitySettings Members

DevExpress.Xpf.Core Namespace