|
1 | | -<Window x:Class="DisplayRowIndexInGridRowHeaderCell.MainWindow" |
2 | | - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | | - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | | - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
5 | | - xmlns:syncfusion="http://schemas.syncfusion.com/wpf" |
6 | | - xmlns:datapager="clr-namespace:Syncfusion.UI.Xaml.Controls.DataPager;assembly=Syncfusion.SfGrid.WPF" |
7 | | - xmlns:interactivity="http://schemas.microsoft.com/xaml/behaviors" |
8 | | - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
9 | | - xmlns:local="clr-namespace:DisplayRowIndexInGridRowHeaderCell" |
10 | | - mc:Ignorable="d" |
11 | | - Title="MainWindow" Height="450" Width="800"> |
12 | | - |
13 | | - |
14 | | - |
15 | | - <Window.DataContext> |
16 | | - <local:ViewModel/> |
17 | | - </Window.DataContext> |
18 | | - |
19 | | - <Window.Resources> |
20 | | - <local:RowIndexConverter x:Key="rowIndexConverter"/> |
21 | | - </Window.Resources> |
22 | | - |
23 | | - <Grid x:Name="Root_Grid"> |
24 | | - <Grid.RowDefinitions> |
25 | | - <RowDefinition Height="auto" /> |
26 | | - <RowDefinition Height="Auto" /> |
27 | | - </Grid.RowDefinitions> |
28 | | - <syncfusion:SfDataGrid x:Name="dataGrid" |
29 | | - AllowFiltering="True" |
30 | | - Margin="10" |
31 | | - ColumnSizer="Star" |
32 | | - AutoGenerateColumns="False" |
33 | | - ItemsSource="{Binding ElementName=dataPager,Path=PagedSource}" |
34 | | - ShowRowHeader="True"> |
35 | | - <syncfusion:SfDataGrid.Columns> |
36 | | - <syncfusion:GridNumericColumn HeaderText="Order ID" MappingName="OrderID" NumberDecimalDigits="0"/> |
37 | | - <syncfusion:GridTextColumn HeaderText="Customer ID" MappingName="CustomerID"/> |
38 | | - <syncfusion:GridTextColumn HeaderText="Customer Name" MappingName="CustomerName"/> |
39 | | - <syncfusion:GridTextColumn MappingName="Country"/> |
40 | | - </syncfusion:SfDataGrid.Columns> |
41 | | - |
42 | | - <syncfusion:SfDataGrid.Resources> |
43 | | - <Style TargetType="syncfusion:GridRowHeaderCell"> |
44 | | - <Setter Property="Template"> |
45 | | - <Setter.Value> |
46 | | - <ControlTemplate TargetType="syncfusion:GridRowHeaderCell"> |
47 | | - <Border x:Name="PART_RowHeaderCellBorder" |
48 | | - Background="Blue" |
49 | | - BorderBrush="{TemplateBinding BorderBrush}" |
50 | | - BorderThickness="{TemplateBinding BorderThickness}"> |
51 | | - <Grid> |
52 | | - <!--//RowIndex is displayed here--> |
53 | | - <TextBlock HorizontalAlignment="Center" |
54 | | - VerticalAlignment="Center" |
55 | | - Foreground="White" |
56 | | - TextAlignment="Center" > |
57 | | - <TextBlock.Text> |
58 | | - <MultiBinding Converter="{StaticResource rowIndexConverter}" > |
59 | | - <Binding Path="RowIndex" RelativeSource="{RelativeSource TemplatedParent}"/> |
60 | | - <Binding ElementName="dataGrid" /> |
61 | | - <Binding ElementName="dataPager" /> |
62 | | - </MultiBinding> |
63 | | - </TextBlock.Text> |
64 | | - </TextBlock> |
65 | | - </Grid> |
66 | | - </Border> |
67 | | - </ControlTemplate> |
68 | | - </Setter.Value> |
69 | | - </Setter> |
70 | | - </Style> |
71 | | - </syncfusion:SfDataGrid.Resources> |
72 | | - </syncfusion:SfDataGrid> |
73 | | - |
74 | | - <datapager:SfDataPager x:Name="dataPager" |
75 | | - Grid.Row="1" |
76 | | - NumericButtonCount="10" |
77 | | - PageSize="10" |
78 | | - Source="{Binding Orders}" /> |
79 | | - |
80 | | - </Grid> |
81 | | - <interactivity:Interaction.Behaviors> |
82 | | - <local:WindowBehavior/> |
83 | | - </interactivity:Interaction.Behaviors> |
84 | | -</Window> |
| 1 | +<Window x:Class="DisplayRowIndexInGridRowHeaderCell.MainWindow" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 5 | + xmlns:syncfusion="http://schemas.syncfusion.com/wpf" |
| 6 | + xmlns:datapager="clr-namespace:Syncfusion.UI.Xaml.Controls.DataPager;assembly=Syncfusion.SfGrid.WPF" |
| 7 | + xmlns:interactivity="http://schemas.microsoft.com/xaml/behaviors" |
| 8 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 9 | + xmlns:local="clr-namespace:DisplayRowIndexInGridRowHeaderCell" |
| 10 | + mc:Ignorable="d" |
| 11 | + Title="MainWindow" Height="450" Width="800"> |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + <Window.DataContext> |
| 16 | + <local:ViewModel/> |
| 17 | + </Window.DataContext> |
| 18 | + |
| 19 | + <Window.Resources> |
| 20 | + <local:RowIndexConverter x:Key="rowIndexConverter"/> |
| 21 | + </Window.Resources> |
| 22 | + |
| 23 | + <Grid x:Name="Root_Grid"> |
| 24 | + <Grid.RowDefinitions> |
| 25 | + <RowDefinition Height="auto" /> |
| 26 | + <RowDefinition Height="Auto" /> |
| 27 | + </Grid.RowDefinitions> |
| 28 | + <syncfusion:SfDataGrid x:Name="dataGrid" |
| 29 | + AllowFiltering="True" |
| 30 | + Margin="10" |
| 31 | + ColumnSizer="Star" |
| 32 | + AutoGenerateColumns="False" |
| 33 | + ItemsSource="{Binding ElementName=dataPager,Path=PagedSource}" |
| 34 | + ShowRowHeader="True"> |
| 35 | + <syncfusion:SfDataGrid.Columns> |
| 36 | + <syncfusion:GridNumericColumn HeaderText="Order ID" MappingName="OrderID" NumberDecimalDigits="0"/> |
| 37 | + <syncfusion:GridTextColumn HeaderText="Customer ID" MappingName="CustomerID"/> |
| 38 | + <syncfusion:GridTextColumn HeaderText="Customer Name" MappingName="CustomerName"/> |
| 39 | + <syncfusion:GridTextColumn MappingName="Country"/> |
| 40 | + </syncfusion:SfDataGrid.Columns> |
| 41 | + |
| 42 | + <syncfusion:SfDataGrid.Resources> |
| 43 | + <Style TargetType="syncfusion:GridRowHeaderCell"> |
| 44 | + <Setter Property="Template"> |
| 45 | + <Setter.Value> |
| 46 | + <ControlTemplate TargetType="syncfusion:GridRowHeaderCell"> |
| 47 | + <Border x:Name="PART_RowHeaderCellBorder" |
| 48 | + Background="Blue" |
| 49 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 50 | + BorderThickness="{TemplateBinding BorderThickness}"> |
| 51 | + <Grid> |
| 52 | + <!--//RowIndex is displayed here--> |
| 53 | + <TextBlock HorizontalAlignment="Center" |
| 54 | + VerticalAlignment="Center" |
| 55 | + Foreground="White" |
| 56 | + TextAlignment="Center" > |
| 57 | + <TextBlock.Text> |
| 58 | + <MultiBinding Converter="{StaticResource rowIndexConverter}" > |
| 59 | + <Binding Path="RowIndex" RelativeSource="{RelativeSource TemplatedParent}"/> |
| 60 | + <Binding ElementName="dataGrid" /> |
| 61 | + <Binding ElementName="dataPager" /> |
| 62 | + </MultiBinding> |
| 63 | + </TextBlock.Text> |
| 64 | + </TextBlock> |
| 65 | + </Grid> |
| 66 | + </Border> |
| 67 | + </ControlTemplate> |
| 68 | + </Setter.Value> |
| 69 | + </Setter> |
| 70 | + </Style> |
| 71 | + </syncfusion:SfDataGrid.Resources> |
| 72 | + </syncfusion:SfDataGrid> |
| 73 | + |
| 74 | + <datapager:SfDataPager x:Name="dataPager" |
| 75 | + Grid.Row="1" |
| 76 | + NumericButtonCount="10" |
| 77 | + PageSize="10" |
| 78 | + Source="{Binding Orders}" /> |
| 79 | + |
| 80 | + </Grid> |
| 81 | + <interactivity:Interaction.Behaviors> |
| 82 | + <local:WindowBehavior/> |
| 83 | + </interactivity:Interaction.Behaviors> |
| 84 | +</Window> |
0 commit comments