[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Grid View Data Layout
   [Collapse]Binding to Data
     Binding to Data Overview
     Binding to ICollectionView
     Virtual Source, Server Mode, Instant Feedback Components
    [Expand]Server Mode
    [Expand]Binding to any Data Source with Virtual Sources
    [Expand]TreeListView Data Binding
     Applying Data Annotations
     Unbound Columns
     Managing Multi-Thread Data Updates
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Filtering and Searching
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus, Navigation, Selection
   [Expand]Conditional Formatting
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Unbound Columns

Expanded Bound and Unbound Columns

The GridControl supports bound and unbound columns:

  • Bound columns obtain their data from data fields in the grid's data source.

  • Unbound columns are not bound to any field in the data source.

    Handle the GridControl.CustomUnboundColumnData / TreeListView.CustomUnboundColumnData event to populate these columns.


    GitHub Example: How to Create Unbound Columns

    This example shows how to add an unbound column to the GridControl. This column should display the total price, calculated as follows: UnitPrice * UnitsOnOrder.

    You can use the ColumnBase.UnboundExpression property to populate an unbound column. The Expressions section describes the syntax for creating expressions.

An unbound column meets the following two requirements:

  • The ColumnBase.FieldName property must be set to a unique value, and not refer to any field in the grid's data source.
  • The ColumnBase.UnboundType property must be set to an appropriate value according to the type of data this column is supposed to display (Boolean, DateTime, Decimal, Integer, String or Object). This property determines an unbound column's default editor, used to represent its values. For example, if it is set to Boolean, a CheckEdit will be used by default. To replace the default editor, use the ColumnBase.EditSettings property.

The GridControl.CustomUnboundColumnData / TreeListView.CustomUnboundColumnData events are raised only for columns where both the FieldName (see ColumnBase.FieldName) and UnboundType (see ColumnBase.UnboundType) properties are specified.

There is no difference between working with bound and unbound columns. You can sort, group, display summaries and filter unbound columns in the same manner as bound columns.

If unbound data is obtained from a custom data source, when adding a new row you should add a new entry to the custom data source that corresponds to the new record in the grid. Similarly, when a record is deleted, delete the corresponding entry in the custom data source. To receive notifications that a record has been added or removed, use the methods provided by a data source.

Expanded Unbound Column's Data

In most instances, data for unbound columns is obtained from a custom data source or is calculated based upon the values of bound columns.

Unbound data can be edited if it is retrieved from a custom data source. After an end-user has changed an unbound column's value, this value should then be saved back to the grid's data source. By default, data editing is enabled. To make an unbound column read-only, set its ColumnBase.ReadOnly property to true. You can also disable data editing by setting the ColumnBase.AllowEditing property to 'False'.

To provide data for unbound columns and save any changes made back to a custom data source, handle the GridControl.CustomUnboundColumnData event. Note that this event is raised only for unbound columns.

Is this topic helpful?​​​​​​​