Skip to main content

LookUpEditBase.ItemsPanel Property

Gets or sets the template that defines the panel that controls the layout of items displayed within the editor's dropdown. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

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

#Declaration

[Browsable(false)]
public ItemsPanelTemplate ItemsPanel { get; set; }

#Property Value

Type Description
ItemsPanelTemplate

A ItemsPanelTemplate object that represents the panel to use for the layout of the items.

#Remarks

If the editor is bound to a large data source, to speed up its performance, set the ItemsPanel property to a VirtualizingStackPanel object. In this case, only a subset of items which are visible on-screen, are generated.

By default, the layout of items is defined by the DevExpress.Xpf.Core.DXVirtualizingStackPanel control with the enabled virtualization. In this instance, vertical scrolling is performed item by item. To activate per-pixel scrolling, do the following:


<dxe:ComboBoxEdit Name="cbEdit1"
                    Width="150" PopupHeight="100">
    <dxe:ComboBoxEdit.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Vertical"/>
        </ItemsPanelTemplate>
    </dxe:ComboBoxEdit.ItemsPanel>
</dxe:ComboBoxEdit>

#Examples

This example shows how to optimize the editor's performance if it is bound to a large data source.

public partial class MainPage : UserControl {
    public MainPage() {
        InitializeComponent();
        comboBoxEdit1.ItemsSource = GenerateData();
    }

    private List<string> GenerateData() {
        List<string> list = new List<string>();
        for (int i = 0; i < 2000; i++)
            list.Add(i.ToString());
        return list;
    }
}
See Also