-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window1.xaml
47 lines (47 loc) · 2.56 KB
/
Window1.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
<Window x:Class="DXGrid_CustomEditors.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DXGrid_CustomEditors"
Title="Window1"
Height="300" Width="500">
<Window.DataContext>
<local:DemoViewModel/>
</Window.DataContext>
<Grid>
<dxg:GridControl x:Name="grid" ItemsSource="{Binding Products}">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="ProductName"/>
<dxg:GridColumn FieldName="UnitPrice">
<dxg:GridColumn.EditSettings>
<dxe:SpinEditSettings DisplayFormat="c2" MinValue="1" MaxValue="999" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="UnitsOnOrder">
<dxg:GridColumn.CellDisplayTemplate>
<DataTemplate>
<ProgressBar Value="{Binding Path=Value, Converter={local:IntToDoubleConverter}}" Minimum="0" Maximum="50" />
</DataTemplate>
</dxg:GridColumn.CellDisplayTemplate>
<dxg:GridColumn.CellEditTemplate>
<DataTemplate>
<Grid VerticalAlignment="Center">
<Slider Minimum="0" Maximum="50" Value="{Binding Path=Value, Mode=TwoWay, Converter={local:IntToDoubleConverter}}" />
<TextBlock Text="{Binding Path=Value}" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" TextWrapping="NoWrap" />
</Grid>
</DataTemplate>
</dxg:GridColumn.CellEditTemplate>
</dxg:GridColumn>
<dxg:GridColumn FieldName="Total" UnboundType="Decimal" UnboundExpression="[UnitPrice] * [UnitsOnOrder]" ReadOnly="True">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings DisplayFormat="c2" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView AutoWidth="True" />
</dxg:GridControl.View>
</dxg:GridControl>
</Grid>
</Window>