[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Collapse]Windows 10 App Controls
  Prerequisites
 [Expand]Getting Started
 [Collapse]Controls
  [Expand]Navigation and Layout
  [Expand]Data Editors
  [Collapse]Data Grid
   [Expand]Getting Started
   [Collapse]Binding to Data
    [Expand]Binding to InfiniteAsyncSource
     Binding to ICollectionView
     Unbound Columns
   [Expand]Data Management
   [Expand]Data Editing
   [Expand]Validation
   [Expand]Asynchronous Virtual Source
   [Expand]Data Scrolling
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Charts
  [Expand]Map Control
  [Expand]Gauges
  [Expand]PDF Viewer
  [Expand]Scheduler
   SVG Icon
   Context Menu
 [Expand]Themes and Color Schemes
  Localization
  Get More Help
 [Expand]API Reference
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[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 Grid Control supports bound and unbound columns. Bound columns obtain their data from data fields in a grid's data source. Unbound columns are not bound to any field in the data source. 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.

An unbound column, however, is one that 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 should display (Boolean, Bound, DateTime, Decimal, Integer, String or Object).
Note

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 the data source.

Note

The Grid Control cannot operate with only unbound columns. It must be bound to a data source using its DataControlBase.ItemsSource property.

Expanded Provide Data for Unbound Columns

Unbound columns must be populated manually. You can use the ColumnBase.UnboundExpression property and specify an expression used to evaluate values for an unbound column based on the items source records.

The sample code below shows how to specify an unbound expression to display the total price, calculated as: UnitPrice * Quantity:

If data for unbound columns is obtained from a custom data source, handle the GridControl.CustomUnboundColumnData event.

Expanded Example: Display Unbound Data

This example shows how to add an unbound column to the Grid Control.

Expanded Updating Unbound Data

In most instances, the grid updates unbound cells automatically. To force unbound data updates manually, use the DataControlBase.UpdateUnboundColumnValues method. This method updates all unbound cells contained within the specified data row regardless of how unbound data s supplied (via event handler or unbound expression).

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