■ GridControl 엘리먼트의 DetailDescriptor 속성을 사용해 마스터-상세를 표시하는 방법을 보여준다.
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
<Window.Resources> <DataTemplate x:Key="NoteDataTemplateKey"> <Border> <TextBlock TextWrapping="Wrap" Text="{Binding Path=Note}" /> </Border> </DataTemplate> </Window.Resources> ... <dxg:GridControl x:Name="gridControl" AutoGenerateColumns="AddNew"> <dxg:GridControl.View> <dxg:TableView ShowGroupPanel="False" AutoWidth="False" DetailHeaderContent="Employee" /> </dxg:GridControl.View> <dxg:GridControl.DetailDescriptor> <dxg:TabViewDetailDescriptor> <dxg:TabViewDetailDescriptor.DetailDescriptors> <dxg:DataControlDetailDescriptor ItemsSourcePath="OrderList"> <dxg:DataControlDetailDescriptor.DataControl> <dxg:GridControl AutoGenerateColumns="AddNew"> <dxg:GridControl.View> <dxg:TableView ShowGroupPanel="False" AutoWidth="False" DetailHeaderContent="Order" /> </dxg:GridControl.View> </dxg:GridControl> </dxg:DataControlDetailDescriptor.DataControl> </dxg:DataControlDetailDescriptor> <dxg:ContentDetailDescriptor ContentTemplate="{StaticResource NoteDataTemplateKey}" HeaderContent="Note"> </dxg:ContentDetailDescriptor> </dxg:TabViewDetailDescriptor.DetailDescriptors> </dxg:TabViewDetailDescriptor> </dxg:GridControl.DetailDescriptor> </dxg:GridControl> |
※ xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid
※ Order, Employee, 클래스는 WPF 프로그램 자료집의 'How to : Setup Simple Tabbed Details'를 참조한다.