Skip to main content

GridPaneLayout.ColumnDefinitions Property

Returns the grid pane layout’s columns.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.2.dll

Declaration

[PersistenceMode(PersistenceMode.InnerProperty)]
[XtraChartsLocalizableCategory(XtraChartsCategory.Elements)]
public LayoutDefinitionCollection ColumnDefinitions { get; }

Property Value

Type Description
LayoutDefinitionCollection

The collection of grid layout columns.

Remarks

The grid pane layout enables you to align the XY-diagram’s panes within columns and rows. Use the XYDiagram2D.PaneLayout to access the pane layout settings. The GridPaneLayout.RowDefinitions property defines a collection of rows, and the GridPaneLayout.ColumnDefinitions property specifies columns. Use the XYDiagramPaneBase.LayoutOptions to configure an individual pane’s layout. The GridLayoutOptions.Column and GridLayoutOptions.Row properties define how to align the pane on the diagram.

Example

This example shows how to arrange chart panes using the grid layout.

Populate the GridPaneLayout.ColumnDefinitions and GridPaneLayout.RowDefinitions collections with LayoutDefinition objects.

Use the LayoutDefinition.Weight or LayoutDefinition.SizeInPixels properties to specify the layout item’s size. Note that you should specify the LayoutDefinition.SizeMode property to define which size property is used.

Use the XYDiagramPaneBase.LayoutOptions property to access the pane layout options. Define the GridLayoutOptions.Column, GridLayoutOptions.ColumnSpan, GridLayoutOptions.Row and GridLayoutOptions.RowSpan properties to specify a pane position.

XYDiagram diagram = chart.Diagram as XYDiagram;
diagram.PaneLayout.AutoLayoutMode = PaneAutoLayoutMode.Grid;
// You can use the AddRange method to add several layout definitions to the collection.
diagram.PaneLayout.ColumnDefinitions.Add(new LayoutDefinition { SizeMode = PaneSizeMode.UseWeight, Weight = 1 });
diagram.PaneLayout.ColumnDefinitions.Add(new LayoutDefinition { SizeMode = PaneSizeMode.UseSizeInPixels, SizeInPixels = 200 });
diagram.PaneLayout.RowDefinitions.Add(new LayoutDefinition());
diagram.PaneLayout.RowDefinitions.Add(new LayoutDefinition());

diagram.DefaultPane.LayoutOptions.Column = 0;
diagram.DefaultPane.LayoutOptions.Row = 0;

diagram.Panes[0].LayoutOptions.Column = 1;
diagram.Panes[0].LayoutOptions.Row = 0;
diagram.Panes[0].LayoutOptions.RowSpan = 2;
diagram.Panes[0].LayoutOptions.ColumnSpan = 1;

diagram.Panes[1].LayoutOptions.Column = 0;
diagram.Panes[1].LayoutOptions.Row = 1;
See Also