-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMainWindow.xaml
67 lines (61 loc) · 3.45 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
59
60
61
62
63
64
65
66
<Window
x:Class="LocalizationDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:LocalizationDemo"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dataGrid="using:Syncfusion.UI.Xaml.DataGrid"
xmlns:grids="using:Syncfusion.UI.Xaml.Grids"
xmlns:editors="using:Syncfusion.UI.Xaml.Editors"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.DataContext>
<local:ViewModel/>
</Grid.DataContext>
<Grid.Resources>
<local:ViewModel x:Key="viewModel"/>
</Grid.Resources>
<dataGrid:SfDataGrid x:Name="datagrid"
AutoGenerateColumns="False"
AllowSorting="True"
AllowEditing="True"
ShowGroupDropArea="True"
AllowFiltering="True"
FilterRowPosition="Top"
LiveDataUpdateMode="AllowDataShaping"
NewItemPlaceholderPosition="AtEnd"
AddNewRowPosition="Top"
ShowRowHeader="True"
AllowDeleting="True"
FrozenRowsCount="2"
SelectionMode="Single"
ItemsSource="{Binding Orders}">
<dataGrid:SfDataGrid.Columns>
<dataGrid:GridNumericColumn HeaderText="Order ID" MappingName="OrderID" />
<dataGrid:GridTextColumn HeaderText="Customer ID" MappingName="CustomerID" ImmediateUpdateColumnFilter="True" />
<dataGrid:GridTextColumn HeaderText="Customer Name" MappingName="CustomerName" ColumnWidthMode="Auto" />
<dataGrid:GridTextColumn HeaderText="Country" MappingName="Country" />
<dataGrid:GridNumericColumn HeaderText="Unit Price" MappingName="UnitPrice" NumberFormatter="{Binding SystemCurrency,Source={StaticResource viewModel}}"/>
<dataGrid:GridCheckBoxColumn MappingName="IsDelivered" HeaderText="IsDelivered" />
</dataGrid:SfDataGrid.Columns>
<dataGrid:SfDataGrid.StackedHeaderRows>
<grids:StackedHeaderRow>
<grids:StackedHeaderRow.StackedColumns>
<grids:StackedColumn ChildColumns="OrderID,CustomerID,CustomerName,UnitPrice,Country" HeaderText="Sales Details" MappingName="SalesDetails"/>
</grids:StackedHeaderRow.StackedColumns>
</grids:StackedHeaderRow>
<grids:StackedHeaderRow>
<grids:StackedHeaderRow.StackedColumns>
<grids:StackedColumn ChildColumns="OrderID" HeaderText="Order Details" MappingName="OrderDetails"/>
<grids:StackedColumn ChildColumns="CustomerID,CustomerName" HeaderText="Customer Details" MappingName="CustomerDetails"/>
<grids:StackedColumn ChildColumns="UnitPrice,Country" HeaderText="Shipping Details" MappingName="ShippingDetails"/>
</grids:StackedHeaderRow.StackedColumns>
</grids:StackedHeaderRow>
</dataGrid:SfDataGrid.StackedHeaderRows>
</dataGrid:SfDataGrid>
</Grid>
</Window>