Back to Devexpress

ColumnDataEventArgsBase.Value Property

wpf-devexpress-dot-xpf-dot-grid-dot-columndataeventargsbase-c75a24d5.md

latest5.3 KB
Original Source

ColumnDataEventArgsBase.Value Property

Gets or sets the processed cell’s value.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public object Value { get; set; }
vb
Public Property Value As Object

Property Value

TypeDescription
Object

An object specifying the value of the cell currently being processed.

|

Remarks

If the ColumnDataEventArgsBase.IsGetData property returns true , you should assign a value to the Value property. If the ColumnDataEventArgsBase.IsSetData property returns true , the Value property’s value should be saved to a data source.

To learn more, see GridControl.CustomUnboundColumnData.

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

wpf-data-grid-change-background-color-for-modified-cells/CS/HighlightChangedCellBehavior.cs#L55

csharp
bool res;
    e.Value = modifiedCells.TryGetValue(key, out res) ? res : false;
}

wpf-data-grid-create-custom-gridcontrol-that-displays-horizontal-columns/CS/dxExample/VGrid/VerticalGridControl.cs#L97

csharp
if (e.IsGetData) {
    e.Value = targetProperty.GetValue(item);
}

wpf-data-grid-create-unbound-columns/CS/DXGrid_UnboundColumns_CodeBehind/Window1.xaml.cs#L15

csharp
int quantity = Convert.ToInt32(e.GetListSourceFieldValue(nameof(Product.Quantity)));
    e.Value = price * quantity;
}

wpf-data-grid-display-icon-in-unbound-column-based-on-value-in-bound-column/CS/UnboundColumnWithIcons_CodeBehind/Window1.xaml.cs#L26

csharp
string resourceName = GetResourceName(row.Action);
    e.Value = GetImage(resourceName);
}

wpf-data-grid-change-background-color-for-modified-cells/VB/HighlightChangedCellBehavior.vb#L77

vb
Dim res As Boolean
    e.Value = If(Me.modifiedCells.TryGetValue(key, res), res, False)
End If

wpf-data-grid-create-custom-gridcontrol-that-displays-horizontal-columns/VB/dxExample/VGrid/VerticalGridControl.vb#L120

vb
If e.IsGetData Then
    e.Value = targetProperty.GetValue(item)
End If

wpf-data-grid-create-unbound-columns/VB/DXGrid_UnboundColumns_CodeBehind/Window1.xaml.vb#L19

vb
Dim quantity As Integer = Convert.ToInt32(e.GetListSourceFieldValue(NameOf(Product.Quantity)))
    e.Value = price * quantity
End If

wpf-data-grid-display-icon-in-unbound-column-based-on-value-in-bound-column/VB/UnboundColumnWithIcons_CodeBehind/Window1.xaml.vb#L29

vb
Dim resourceName As String = GetResourceName(row.Action)
    e.Value = GetImage(resourceName)
End If

See Also

ColumnDataEventArgsBase Class

ColumnDataEventArgsBase Members

DevExpress.Xpf.Grid Namespace