File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/DataGrid Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ public async void OnXamlRendered(FrameworkElement control)
41
41
dataGrid . Sorting += DataGrid_Sorting ;
42
42
dataGrid . LoadingRowGroup += DataGrid_LoadingRowGroup ;
43
43
dataGrid . ItemsSource = await viewModel . GetDataAsync ( ) ;
44
+ dataGrid . PreparingCellForEdit += DataGrid_PreparingCellForEdit ;
44
45
45
46
var comboBoxColumn = dataGrid . Columns . FirstOrDefault ( x => x . Tag ? . Equals ( "Mountain" ) == true ) as DataGridComboBoxColumn ;
46
47
if ( comboBoxColumn != null )
@@ -111,6 +112,15 @@ public async void OnXamlRendered(FrameworkElement control)
111
112
}
112
113
}
113
114
115
+ private void DataGrid_PreparingCellForEdit ( object sender , DataGridPreparingCellForEditEventArgs e )
116
+ {
117
+ if ( e . Column is DataGridTemplateColumn column && ( string ) column ? . Tag == "First_ascent" &&
118
+ e . EditingElement is CalendarDatePicker calendar )
119
+ {
120
+ calendar . IsCalendarOpen = true ;
121
+ }
122
+ }
123
+
114
124
private void DataGrid_LoadingRowGroup ( object sender , DataGridRowGroupHeaderEventArgs e )
115
125
{
116
126
ICollectionViewGroup group = e . RowGroupHeader . CollectionViewGroup ;
You can’t perform that action at this time.
0 commit comments