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.1.dll
NuGet Packages: DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
Declaration
Property Value
| Type | Description |
|---|---|
| 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 Height
- Place the grid in a container (for example, Grid or DockPanel) that assigns a finite size to it.
- Set Height or MaxHeight
- Explicitly set the grid’s size or maximum allowed size (for example,
HeightorMaxHeight).
Allow Infinite Height
Enable the AllowInfiniteGridSize setting at application startup:
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.