This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
58 lines (58 loc) · 3.58 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<Window x:Class="Default_MVVM.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:local="clr-namespace:Default_MVVM"
Title="MainWindow" Height="550" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition MaxHeight="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="DxGrid" FontSize="20" FontWeight="ExtraBold"/>
<dxg:GridControl x:Name="grid" ItemsSource="{Binding Records}" Grid.Row="1">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Text"/>
<dxg:GridColumn FieldName="Number" FilterPopupMode="Custom">
<dxg:GridColumn.CustomColumnFilterPopupTemplate>
<DataTemplate>
<ScrollViewer Focusable="False" MaxHeight="350">
<StackPanel>
<dxe:ListBoxEdit
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=dxg:GridControl},
Converter={local:FilterPopupConverter}}"
ValueMember="Number" DisplayMember="Number">
<dxe:ListBoxEdit.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Image}" Margin="3,3,3,3" Width="70" Height="70"/>
<TextBlock Text="{Binding Number}" Margin="3,3,3,3" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</dxe:ListBoxEdit.ItemTemplate>
<dxe:ListBoxEdit.EditValue>
<MultiBinding Converter="{local:CriteriaOperatorConverter}" Mode="OneWayToSource">
<Binding Path="CustomColumnFilter"
RelativeSource="{RelativeSource TemplatedParent}"/>
<Binding Path="(dxe:BaseEdit.OwnerEdit).IsPopupOpen"
RelativeSource="{RelativeSource TemplatedParent}"/>
</MultiBinding>
</dxe:ListBoxEdit.EditValue>
</dxe:ListBoxEdit>
</StackPanel>
</ScrollViewer>
</DataTemplate>
</dxg:GridColumn.CustomColumnFilterPopupTemplate>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Image">
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding RowData.Row.Image}" Margin="5,5,5,5"/>
</DataTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
</dxg:GridControl.Columns>
</dxg:GridControl>
</Grid>
</Window>