-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
57 lines (56 loc) · 3.38 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
<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:WpfApplication25"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
x:Class="WpfApplication25.MainWindow"
mc:Ignorable="d"
Title="How to use scrollbar annotations" Height="350" Width="525">
<Window.DataContext>
<local:ViewModel></local:ViewModel>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="150"></ColumnDefinition>
</Grid.ColumnDefinitions>
<dxg:GridControl x:Name="myGrid" AutoGenerateColumns="AddNew" EnableSmartColumnsGeneration="True" ItemsSource="{Binding List}" AllowLiveDataShaping ="True" SelectionMode="Cell" Grid.RowSpan="2">
<dxg:GridControl.View>
<dxg:TableView x:Name="myView" AllowPerPixelScrolling="True" ShowSearchPanelMode="Always" ScrollBarAnnotationMode="{Binding EditValue, ElementName= myListBoxEdit, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay }" ScrollBarCustomRowAnnotation ="MyScrollBarCustomRowAnnotationEventHandler" SearchPanelAllowFilter="False" Loaded="MyLoadedEventHandler">
<dxg:TableView.FormatConditions>
<dxg:FormatCondition Expression="[Number] > 2.0m and [Number] < 4.0m" FieldName="Number" ApplyToRow="True">
<dx:Format Background="Green"/>
</dxg:FormatCondition>
<dxg:FormatCondition Expression="[Number] > 10.0m and [Number] < 15.0m" FieldName="Number" ApplyToRow="True">
<dx:Format Background="LightCoral" />
</dxg:FormatCondition>
</dxg:TableView.FormatConditions>
</dxg:TableView>
</dxg:GridControl.View>
</dxg:GridControl>
<dxe:ListBoxEdit x:Name="myListBoxEdit" Grid.Column="1" Grid.Row="1" SelectedIndex="6">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EnumItemsSourceBehavior EnumType="{x:Type dxg:ScrollBarAnnotationMode}" SortMode="DisplayName"/>
</dxmvvm:Interaction.Behaviors>
<dxe:ListBoxEdit.StyleSettings>
<dxe:RadioListBoxEditStyleSettings/>
</dxe:ListBoxEdit.StyleSettings>
<dxe:ListBoxEdit.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</dxe:ListBoxEdit.ItemTemplate>
</dxe:ListBoxEdit>
<TextBlock Text="Choose the required mode:" Grid.Column="1" Grid.Row="0" Margin="3,0,0,0"></TextBlock>
</Grid>
</Window>