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)
4141 dataGrid . Sorting += DataGrid_Sorting ;
4242 dataGrid . LoadingRowGroup += DataGrid_LoadingRowGroup ;
4343 dataGrid . ItemsSource = await viewModel . GetDataAsync ( ) ;
44+ dataGrid . PreparingCellForEdit += DataGrid_PreparingCellForEdit ;
4445
4546 var comboBoxColumn = dataGrid . Columns . FirstOrDefault ( x => x . Tag ? . Equals ( "Mountain" ) == true ) as DataGridComboBoxColumn ;
4647 if ( comboBoxColumn != null )
@@ -111,6 +112,15 @@ public async void OnXamlRendered(FrameworkElement control)
111112 }
112113 }
113114
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+
114124 private void DataGrid_LoadingRowGroup ( object sender , DataGridRowGroupHeaderEventArgs e )
115125 {
116126 ICollectionViewGroup group = e . RowGroupHeader . CollectionViewGroup ;
You can’t perform that action at this time.
0 commit comments