GridControl.CustomUnboundColumnData Event
Enables data to be supplied to unbound columns.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v18.2.dll
Declaration
Event Data
The CustomUnboundColumnData event's data class is GridColumnDataEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Column | Gets the unbound column currently being processed. |
IsGetData | Gets whether you should provide data for the currently processed cell. Inherited from ColumnDataEventArgsBase. |
IsSetData | Gets whether a cell’s value should be saved to a data source. Inherited from ColumnDataEventArgsBase. |
ListSourceRowIndex | Gets the index of the record in a data source to which the processed row corresponds. |
Source | Gets the grid control that raised the event. |
Value | Gets or sets the processed cell’s value. Inherited from ColumnDataEventArgsBase. |
The event data class exposes the following methods:
Method | Description |
---|---|
GetListSourceFieldValue(Int32, String) | Returns the value of the specified cell within the specified row in the grid’s data source. |
GetListSourceFieldValue(String) | Returns the value of the specified cell within the processed row in the grid’s data source. |
Remarks
Unbound columns are not bound to any field in the data source. In most instances, data for unbound columns is obtained from a custom data source or is calculated based upon the values of bound columns. To provide data for unbound columns and save any changes made back to a custom data source, handle the CustomUnboundColumnData event.
Display Unbound Data
The event parameter’s ColumnDataEventArgsBase.IsGetData property returns true. The event is raised for each data row, allowing the values of unbound columns to be specified. The processed row’s index in a grid’s data source is returned by the GridColumnDataEventArgs.ListSourceRowIndex property. A value should be assigned to the ColumnDataEventArgsBase.Value property.
Save Changes
The event parameter’s ColumnDataEventArgsBase.IsSetData property returns true. The ColumnDataEventArgsBase.Value property contains the modified cell value that should be saved to a custom data source.
Note
The TreeListView provides its own TreeListView.CustomUnboundColumnData event.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CustomUnboundColumnData event.
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.