|
20 | 20 | materialDesign:DataGridAssist.CellPadding="13 8 8 8" materialDesign:DataGridAssist.ColumnHeaderPadding="8"> |
21 | 21 | <DataGrid.Columns> |
22 | 22 | <DataGridCheckBoxColumn Binding="{Binding IsSelected}" |
23 | | - ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}" |
24 | | - EditingElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnEditingStyle}"> |
| 23 | + ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}" |
| 24 | + EditingElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnEditingStyle}" |
| 25 | + > |
25 | 26 | <DataGridCheckBoxColumn.Header> |
26 | 27 | <!--padding to allow hit test to pass thru for sorting --> |
27 | 28 | <Border Background="Transparent" Padding="6 0 6 0" HorizontalAlignment="Center"> |
28 | 29 | <CheckBox HorizontalAlignment="Center" |
29 | | - DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=DataContext}" |
30 | | - IsChecked="{Binding IsAllItems3Selected}" /> |
| 30 | + DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=DataContext}" |
| 31 | + IsChecked="{Binding IsAllItems3Selected}" /> |
31 | 32 | </Border> |
32 | 33 | </DataGridCheckBoxColumn.Header> |
33 | 34 | </DataGridCheckBoxColumn> |
34 | 35 | <DataGridTextColumn Binding="{Binding Code}" |
35 | | - Header="Code" |
36 | | - EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}" |
37 | | - /> |
| 36 | + Header="Code" |
| 37 | + EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}" /> |
38 | 38 | <!-- if you want to use the pop up style (MaterialDesignDataGridTextColumnPopupEditingStyle), you must use MaterialDataGridTextColumn --> |
39 | 39 | <materialDesign:MaterialDataGridTextColumn Binding="{Binding Name}" |
40 | | - Header="Name" |
41 | | - EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}" |
42 | | - /> |
| 40 | + Header="Name" |
| 41 | + EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}" |
| 42 | + /> |
43 | 43 | <!-- set a max length to get an indicator in the editor --> |
44 | 44 | <materialDesign:MaterialDataGridTextColumn Binding="{Binding Description}" |
45 | | - Header="Description" |
46 | | - MaxLength="255" |
47 | | - EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}" |
48 | | - /> |
| 45 | + Header="Description" |
| 46 | + MaxLength="255" |
| 47 | + EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}" /> |
49 | 48 | <materialDesign:MaterialDataGridTextColumn Binding="{Binding Numeric}" |
50 | 49 | Header="Numeric" |
51 | 50 | EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}"> |
|
63 | 62 |
|
64 | 63 | <!-- use custom combo box column to get better combos. Use ItemsSourceBinding as your binding template to be applied to each combo --> |
65 | 64 | <materialDesign:MaterialDataGridComboBoxColumn Header="Food" |
66 | | - SelectedValueBinding="{Binding Food}" |
67 | | - ItemsSourceBinding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}, Path=DataContext.Foods}" /> |
| 65 | + SelectedValueBinding="{Binding Food}" |
| 66 | + ItemsSourceBinding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}, Path=DataContext.Foods}" /> |
68 | 67 | </DataGrid.Columns> |
69 | 68 | </DataGrid> |
70 | 69 | <TextBlock Margin="0 24 0 0">Auto Generated Columns</TextBlock> |
|
0 commit comments