Back to Devexpress

PropertyEditor.NullText Property

expressappframework-devexpress-dot-expressapp-dot-editors-dot-propertyeditor-320c2cd0.md

latest2.8 KB
Original Source

PropertyEditor.NullText Property

Specifies the text that a Property Editor displays when its value is null or String.Empty. WinForms Property Editors also show this text if their value is DBNull.Value.

Namespace : DevExpress.ExpressApp.Editors

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public virtual string NullText { get; set; }
vb
Public Overridable Property NullText As String

Property Value

TypeDescription
String

A text that a Property Editor displays when its value is null, String.Empty, or DBNull.Value (WinForms only).

|

Remarks

The following View Controller created in the MySolution\Module\Controllers folder shows how to specify this property for the “Address1” Property Editor in the Contact Detail View.

csharp
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
// ...
public class CustomizeNullTextValueController : ObjectViewController<DetailView, Contact> {
    protected override void OnActivated() {
        base.OnActivated();
        PropertyEditor propertyEditor = View.FindItem("Address1") as PropertyEditor;
        if (propertyEditor != null) {
            propertyEditor.NullText = "Type your text here…";
        }
    }
}

The following image illustrates the result.

Note

You can also set the NullText property in the Model Editor.

See Also

PropertyEditor Class

PropertyEditor Members

DevExpress.ExpressApp.Editors Namespace