Skip to main content

ListBoxEditStyleSettings.ShowEmptyItem Property

Gets or sets whether the list box displays the empty item. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

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

NuGet Package: DevExpress.Wpf.Core

Declaration

public bool ShowEmptyItem { get; set; }

Property Value

Type Description
Boolean

true, to show the empty item; otherwise, false.

Remarks

The ListBoxEdit control can display the empty item above its other items. When an end-user selects the empty item, the control’s EditValue is set to null.

Use the ShowEmptyItem property to control the availability of the empty item in the list box editor. The EmptyItemText property allows you to change the default empty item‘s text.

The image below illustrates the empty item with the default text.

empty item

The code sample below demonstrates how to enable the empty item.

<dxe:ListBoxEdit>
    <dxe:ListBoxEdit.StyleSettings>
        <dxe:ListBoxEditStyleSettings ShowEmptyItem="True"/>
    </dxe:ListBoxEdit.StyleSettings>
    <dxe:ListBoxEditItem Content="Item 1"/>
    <dxe:ListBoxEditItem Content="Item 2"/>
    <dxe:ListBoxEditItem Content="Item 3"/>
</dxe:ListBoxEdit>
See Also