Back to Devexpress

LookUpEditBase.ItemsPanel Property

wpf-devexpress-dot-xpf-dot-editors-dot-lookupeditbase-ffa30688.md

latest2.7 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
[Browsable(false)]
public ItemsPanelTemplate ItemsPanel { get; set; }
vb
<Browsable(False)>
Public Property ItemsPanel As ItemsPanelTemplate

Property Value

TypeDescription
ItemsPanelTemplate

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

|

Remarks

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:

xaml
<dxe:ComboBoxEdit Name="cbEdit1"
                    Width="150" PopupHeight="100"
                    ScrollViewer.CanContentScroll="False"/>

See the ItemsPanel topic for more information.

Example

This example shows how to speed up the editor’s performance if it is bound to a large data source.

csharp
public MainWindow() {
    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;
}
xaml
<dxe:ComboBoxEdit Name="comboBoxEdit1" Width="170"
                    HorizontalAlignment="Left" VerticalAlignment="Top">
    <dxe:ComboBoxEdit.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel/>
        </ItemsPanelTemplate>
    </dxe:ComboBoxEdit.ItemsPanel>
</dxe:ComboBoxEdit>

See Also

LookUpEditBase Class

LookUpEditBase Members

DevExpress.Xpf.Editors Namespace