ScaleGridOptionsBase.AutoGrid Property

Gets or sets the value specifying whether the alignment, spacing and offset of grid lines and major tickmarks should be calculated automatically.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v21.2.dll


public bool AutoGrid { get; set; }

Property Value

Type Description

true, if grid spacing is performed automatically; otherwise, false.

Property Paths

You can access this nested property as listed below:


The AutoGrid property is tightly interrelated with the ScaleGridOptionsBase.GridSpacing, ScaleGridOptionsBase.GridOffset and NumericScaleOptions.GridAlignment(DateTimeScaleOptions.GridAlignment) properties. Changing the value of one property affects the other. By default, the AutoGrid property is set to true and the grid line spacing is calculated automatically.

The following images demonstrate how the AutoGrid property works.

AutoGrid = true;

(auto) GridAlignment = Week;

(auto) GridSpacing = 1;

AutoGrid = false;

GridAlignment = Day;

GridSpacing = 3;



Note that if you need to define a custom grid interval, change the value of the ScaleGridOptionsBase.GridSpacing, ScaleGridOptionsBase.GridOffset or NumericScaleOptions.GridAlignment(DateTimeScaleOptions.GridAlignment) property. This automatically sets the AutoGrid property to false.

For more information, refer to Axis Scale Types.


Use AxisBase.NumericScaleOptions, AxisBase.DateTimeScaleOptions, AxisBase.TimeSpanScaleOptions or AxisXBase.QualitativeScaleOptions to access the AutoGrid property.

NumericScaleOptions xAxisOptions = ((XYDiagram)chartControl1.Diagram).AxisX.NumericScaleOptions;
xAxisOptions.AutoGrid = true;
See Also