Skip to main content
All docs
V24.1
Tag

ColumnBase.UnboundDataType Property

Gets or sets the type of data stored in the unbound column. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.1.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

[Browsable(false)]
[DefaultValue(typeof(void))]
public Type UnboundDataType { get; set; }

Property Value

Type Default Description
Type void

The type of data stored in the unbound column.

Remarks

If the UnboundDataType property is not set to an existing data type, the column is considered bound to a data source field.

Follow the steps below:

  1. Add a GridColumn object to the GridControl.Columns collection.
  2. Set the UnboundDataType property to the type of values the column should store. The GridControl chooses the column’s default editor based on this property value. To replace the editor, use the ColumnBase.EditSettings property.
  3. Assign a unique field name to the ColumnBase.FieldName property. The field name must not match the field name of another column or the name of a data source field.
  4. Use one of the following techniques to populate the unbound column with data:
<Window ...
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:sys="clr-namespace:System;assembly=mscorlib">
<dxg:GridControl x:Name="grid">
    <!-- ... -->
    <dxg:GridColumn FieldName="Total" 
                    UnboundDataType="{x:Type sys:Decimal}"
                    UnboundExpression="[Quantity] * [UnitPrice]"/>
</dxg:GridControl>
grid.Columns.Add(new DevExpress.Xpf.Grid.GridColumn() { 
    FieldName = "Total", 
    UnboundDataType = typeof(decimal), 
    UnboundExpression = "[Quantity] * [UnitPrice]"
});

Refer to the following help topic for more information: Unbound Columns.

The following code snippets (auto-collected from DevExpress Examples) contain references to the UnboundDataType 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.

See Also