Back to Devexpress

BaseEdit.NullValue Property

wpf-devexpress-dot-xpf-dot-editors-dot-baseedit-f323f9d3.md

latest2.1 KB
Original Source

BaseEdit.NullValue Property

Gets or sets a null value for the editor, in addition to null and DBNull values. This is a dependency property.

Namespace : DevExpress.Xpf.Editors

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

NuGet Package : DevExpress.Wpf.Core

Declaration

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

Property Value

TypeDescription
Object

An object that represents the null value.

|

Remarks

To specify the text displayed within the edit box when the editor’s value is null, use the BaseEdit.NullText property. Its visibility is specified by the BaseEdit.ShowNullText property.

The following code sample uses the NullValue and NullText properties to display the -= zero =- string for zero values:

xaml
<dxe:TextEdit EditValueType="{x:Type sys:Double}"
              MaskType="Numeric" Mask="#,##0.00;(#,##0.00)" 
              MaskUseAsDisplayFormat="True"
              NullText="-= zero =-"
              NullTextForeground="Black">
    <dxe:TextEdit.NullValue>
        <sys:Double>0.00</sys:Double>
    </dxe:TextEdit.NullValue>
</dxe:TextEdit>

Use the TextEditBase.NullTextForeground property to change the null text’s foreground color.

See Also

NullText

ShowNullText

BaseEdit Class

BaseEdit Members

DevExpress.Xpf.Editors Namespace