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.2.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
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:
- Add a GridColumn object to the GridControl.Columns collection.
- 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. - 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.
- Use one of the following techniques to populate the unbound column with data:
- Specify an expression (ColumnBase.UnboundExpression) that calculates column values. The Expressions section describes supported syntax.
- Handle the GridControl.CustomUnboundColumnData/TreeListView.CustomUnboundColumnData event to specify unbound column values.
<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.
Related GitHub Examples
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.