Skip to main content

GridOptionsView.AutoCalcPreviewLineCount Property

Gets or sets a value specifying whether the number of text lines within preview sections is calculated automatically depending on their contents.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation


public virtual bool AutoCalcPreviewLineCount { get; set; }

Property Value

Type Default Description
Boolean false

true to enable automatic calculation of preview sections’ height; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to AutoCalcPreviewLineCount
.OptionsView .AutoCalcPreviewLineCount


If active, the number of text lines within preview sections is automatically reduced if the text to be displayed requires fewer lines than specified by the GridView.PreviewLineCount property. This allows you to remove empty lines within preview sections. Note that you can also apply automatic calculation without having the predefined maximum text lines displayed. Set the GridView.PreviewLineCount property to -1 for this purpose.

When the AutoCalcPreviewLineCount option is enabled, preview sections may have different heights. The image below illustrates this.


The GridView.MeasurePreviewHeight event provides the ability to specify the height of individual preview sections.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AutoCalcPreviewLineCount property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also