/
MainWindow.xaml
28 lines (26 loc) · 1.3 KB
/
MainWindow.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
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPFGrid_ColumnChooser"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
x:Class="WPFGrid_ColumnChooser.MainWindow"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="500">
<Window.Resources>
<DataTemplate x:Key="columnChooserTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding}"/>
<Button Content="Click" Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>
<local:HeaderTemplateSelector x:Key="headerTemplateSelector"
ColumnChooserTemplate="{StaticResource columnChooserTemplate}"/>
</Window.Resources>
<dxg:GridControl x:Name="grid" AutoGenerateColumns="AddNew">
<dxg:GridControl.View>
<dxg:TableView x:Name="view" ColumnHeaderTemplateSelector="{StaticResource headerTemplateSelector}"/>
</dxg:GridControl.View>
</dxg:GridControl>
</Window>