Back to Devexpress

CustomDisplayTextEventArgs.Value Property

windowsforms-devexpress-dot-xtraeditors-dot-controls-dot-customdisplaytexteventargs-ddd619e2.md

latest4.0 KB
Original Source

CustomDisplayTextEventArgs.Value Property

Gets an editor’s current value.

Namespace : DevExpress.XtraEditors.Controls

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

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

Property Value

TypeDescription
Object

An object that represents an editor’s current value.

|

Remarks

The Value property contains the current value. To provide custom display text for this value, you can format the value according to your needs and then assign the string to the CustomDisplayTextEventArgs.DisplayText property.

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.

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/CS/EFCore/EnumCheckBoxEF/EnumCheckBoxEF.Win/Editors/EnumPropertyEditorEx.cs#L69

csharp
return;
    e.DisplayText = GetCaption((Enum)e.Value);
}

winforms-lookup-display-custom-text-for-not-found-edit-value/CS/Form1.cs#L54

csharp
if(props != null && (e.Value is int)) {
    object row = props.GetDataSourceRowByKeyValue(e.Value);

winforms-filtercontrol-implement-ifilteredcomponent/CS/Q200298/Form1.cs#L29

csharp
if (e.DisplayText == string.Empty) {
    object o = e.Value;
}

winforms-lookup-display-custom-text-for-not-found-edit-value/VB/Form1.vb#L54

vb
If props IsNot Nothing AndAlso (TypeOf e.Value Is Integer) Then
    Dim row As Object = props.GetDataSourceRowByKeyValue(e.Value)

winforms-filtercontrol-implement-ifilteredcomponent/VB/Q200298/Form1.vb#L26

vb
If Equals(e.DisplayText, String.Empty) Then
    Dim o As Object = e.Value
End If

See Also

DisplayText

CustomDisplayTextEventArgs Class

CustomDisplayTextEventArgs Members

DevExpress.XtraEditors.Controls Namespace