DevExpress/개발

DevExpress ListBoxEdit Orientation Horizontal 설정

푸코잇 2023. 4. 24. 09:37
728x90

DevExpress에서 제공하는 ListBoxEdit 컨트롤의 Orientation을 Horizontal로 설정하는 방법을 알아보자.

 

ListBoxEdit 네임스페이스 선언

ListBoxEdit 컨트롤을 사용하기 위해 다음과 같이 네임스페이스를 선언해줘야 한다.

xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"

 

ListBoxEdit 디폴트 Orientation

ListBoxEdit 컨트롤은 Orientation이 디폴트로 Vertical이다.

 

<dx:ThemedWindow x:Class="ListBoxEditOrientation.MainWindow"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                 xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 Title="MainWindow" Height="150" Width="200">
    <StackPanel>
        <dxe:ListBoxEdit>
            <dxe:ListBoxEditItem Content="A"/>
            <dxe:ListBoxEditItem Content="B"/>
            <dxe:ListBoxEditItem Content="C"/>
        </dxe:ListBoxEdit>
    </StackPanel>
</dx:ThemedWindow>
  • 실행결과

 

ListBoxEdit Orientation 설정

ListBoxEdit의 Orientation을 설정하기 위해 ItemsPanel 속성 값을 설정해줘야 한다.

<dx:ThemedWindow x:Class="ListBoxEditOrientation.MainWindow"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                 xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 Title="MainWindow" Height="150" Width="200">
    <StackPanel>
        <dxe:ListBoxEdit>
            <dxe:ListBoxEdit.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </dxe:ListBoxEdit.ItemsPanel>
            <dxe:ListBoxEditItem Content="A"/>
            <dxe:ListBoxEditItem Content="B"/>
            <dxe:ListBoxEditItem Content="C"/>
        </dxe:ListBoxEdit>
    </StackPanel>
</dx:ThemedWindow>
  • 실행결과