Back to Devexpress

GridColumn.UnboundType Property

windowsforms-devexpress-dot-xtragrid-dot-columns-dot-gridcolumn-e2bbbb40.md

latest8.8 KB
Original Source

GridColumn.UnboundType Property

Specifies whether this column is unbound, and if so, the type of data it stores.

Namespace : DevExpress.XtraGrid.Columns

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DefaultValue(UnboundColumnType.Bound)]
[DXCategory("Data")]
[EditorBrowsable(EditorBrowsableState.Never)]
[XtraSerializableProperty]
public UnboundColumnType UnboundType { get; set; }
vb
<DXCategory("Data")>
<DefaultValue(UnboundColumnType.Bound)>
<XtraSerializableProperty>
<EditorBrowsable(EditorBrowsableState.Never)>
Public Property UnboundType As UnboundColumnType

Property Value

TypeDefaultDescription
UnboundColumnTypeBound

An UnboundColumnType enumeration value that specifies the data type and binding mode of the column.

|

Available values:

NameDescription
Bound

Indicates that the column is bound to a field in the control’s underlying data source. The type of data this column contains is determined by the bound field.

| | Integer |

Indicates that the column is unbound and it contains integer values (the Int32 type).

| | Decimal |

Indicates that the column is unbound and it contains decimal values (the Decimal type).

| | DateTime |

Indicates that the column is unbound and it contains date/time values (the DateTime type).

| | String |

Indicates that the column is unbound and it contains string values (the String type).

| | Boolean |

Indicates that the column is unbound and it contains Boolean values (the Boolean type).

| | Object |

Indicates that the column is unbound and it contains values of any type. A TextEdit editor is assigned for the in-place editing of such a column.

|

Remarks

In v21.1 and higher, the UnboundType property is hidden. Use the GridColumn.UnboundDataType property instead to make a column unbound and specify the column’s data type. Compared to the UnboundType property, the GridColumn.UnboundDataType property can accept any data type (including previously unavailable TimeSpan and DateTimeOffset ).

The following code snippets (auto-collected from DevExpress Examples) contain references to the UnboundType property.

Note

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.

XAF-how-to-add-an-unbound-column-to-gridlisteditor-to-execute-a-custom-action-for-a-record/CS/EFCore/ButtonInListEF/ButtonInListEF.Win/Controllers/SimpleBusinessActionGridListViewController.cs#L57

csharp
if(buttonColumn != null) {
    buttonColumn.UnboundType = UnboundColumnType.Boolean;
    buttonColumn.Caption = ButtonColumnCaption;

winforms-grid-create-populate-unbound-column/CS/WindowsApplication1/Form1.cs#L40

csharp
GridColumn col = gridView1.Columns.AddVisible("Unbound", "Unbound column");
    col.UnboundType = DevExpress.Data.UnboundColumnType.String;
}

winforms-grid-multiple-row-selection-web-style-checkboxes/CS/E1271/CheckMarkSelection.cs#L125

csharp
column.OptionsColumn.AllowSize = false;
column.UnboundType = DevExpress.Data.UnboundColumnType.Boolean;
column.Width = GetCheckBoxWidth();

winforms-grid-use-coloredit-to-edit-unbound-column-string-values/CS/ColorEditExample/Form1.cs#L33

csharp
unboundColumn.VisibleIndex = gridView1.Columns.Count;
unboundColumn.UnboundType = DevExpress.Data.UnboundColumnType.Object;
RepositoryItemColorEdit ce = new RepositoryItemColorEdit();

winforms-grid-add-radio-group-column/CS/Helper/GridRadioGroupColumnHelper.cs#L90

csharp
RadioGroupColumn.Caption = "Radio";
RadioGroupColumn.UnboundType = DevExpress.Data.UnboundColumnType.Boolean;
RadioGroupColumn.MaxWidth = 50;

winforms-grid-create-populate-unbound-column/VB/WindowsApplication1/Form1.vb#L41

vb
Dim col As GridColumn = gridView1.Columns.AddVisible("Unbound", "Unbound column")
    col.UnboundType = DevExpress.Data.UnboundColumnType.String
End Sub

winforms-grid-multiple-row-selection-web-style-checkboxes/VB/E1271/CheckMarkSelection.vb#L154

vb
column.OptionsColumn.AllowSize = False
column.UnboundType = Data.UnboundColumnType.Boolean
column.Width = GetCheckBoxWidth()

winforms-grid-use-coloredit-to-edit-unbound-column-string-values/VB/ColorEditExample/Form1.vb#L26

vb
unboundColumn.VisibleIndex = gridView1.Columns.Count
unboundColumn.UnboundType = DevExpress.Data.UnboundColumnType.Object
Dim ce As RepositoryItemColorEdit = New RepositoryItemColorEdit()

winforms-grid-add-radio-group-column/VB/Helper/GridRadioGroupColumnHelper.vb#L91

vb
RadioGroupColumn.Caption = "Radio"
RadioGroupColumn.UnboundType = DevExpress.Data.UnboundColumnType.Boolean
RadioGroupColumn.MaxWidth = 50

winforms-grid-display-summary-calculated-over-detail-rows-in-master-row/VB/WindowsApplication59/Form1.vb#L20

vb
Dim col As GridColumn = gridView1.Columns.AddField("Tasks")
col.UnboundType = DevExpress.Data.UnboundColumnType.Integer
col.Visible = True

See Also

UnboundDataType

CustomUnboundColumnData

UnboundExpression

Expressions

Unbound Columns

GridColumn Class

GridColumn Members

DevExpress.XtraGrid.Columns Namespace