Back to Devexpress

OptionsColumnEditForm.ColumnSpan Property

windowsforms-devexpress-dot-xtragrid-dot-columns-dot-optionscolumneditform-0e1dcd33.md

latest4.5 KB
Original Source

OptionsColumnEditForm.ColumnSpan Property

Gets or sets the number of layout columns the editor spans within an Edit Form. Set the OptionsColumnEditForm.UseEditorColRowSpan property to false for the ColumnSpan property to be in effect.

Namespace : DevExpress.XtraGrid.Columns

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DefaultValue(1)]
[XtraSerializableProperty]
public virtual int ColumnSpan { get; set; }
vb
<DefaultValue(1)>
<XtraSerializableProperty>
Public Overridable Property ColumnSpan As Integer

Property Value

TypeDefaultDescription
Int321

The number of layout columns within an Edit Form the editor spans.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ColumnSpan
GridColumn

.OptionsEditForm .ColumnSpan

|

Remarks

Each editor within an Edit Form spans one or more layout columns. If the OptionsColumnEditForm.UseEditorColRowSpan property is set to true, each editor spans a default number of layout columns and rows and these values depend on the editor type. Except for the MemoEdit and the PictureEdit controls, all editors span one layout column and one layout row. By default, the MemoEdit spans three rows and all layout columns (this number is specified by the GridOptionsEditForm.EditFormColumnCount property). The PictureEdit spans two layout columns and three rows by default.

You can specify a custom number of layout columns an editor spans within an Edit Form via the ColumnSpan property of the corresponding grid column. The OptionsColumnEditForm.RowSpan property allows you to specify a custom number of layout rows an editor spans.

Note

Ensure that the OptionsColumnEditForm.UseEditorColRowSpan property is set to false, for the ColumnSpan and OptionsColumnEditForm.RowSpan properties to be in effect.

csharp
gridView1.OptionsBehavior.EditingMode = DevExpress.XtraGrid.Views.Grid.GridEditingMode.EditForm;
colProductID.OptionsEditForm.UseEditorColRowSpan = false;
colProductID.OptionsEditForm.ColumnSpan = 2;
vb
gridView1.OptionsBehavior.EditingMode = DevExpress.XtraGrid.Views.Grid.GridEditingMode.EditForm
colProductID.OptionsEditForm.UseEditorColRowSpan = False
colProductID.OptionsEditForm.ColumnSpan = 2

In the following picture, the “Product” editor spans two layout columns within an Edit Form whereas other editors span one layout column.

See Also

RowSpan

UseEditorColRowSpan

EditFormColumnCount

OptionsColumnEditForm Class

OptionsColumnEditForm Members

DevExpress.XtraGrid.Columns Namespace