Add PreparingCellForEdit example to open CalendarDropDown on 2nd click
This commit is contained in:
Родитель
99d587f939
Коммит
e89cac670b
|
@ -41,6 +41,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
dataGrid.Sorting += DataGrid_Sorting;
|
||||
dataGrid.LoadingRowGroup += DataGrid_LoadingRowGroup;
|
||||
dataGrid.ItemsSource = await viewModel.GetDataAsync();
|
||||
dataGrid.PreparingCellForEdit += DataGrid_PreparingCellForEdit;
|
||||
|
||||
var comboBoxColumn = dataGrid.Columns.FirstOrDefault(x => x.Tag?.Equals("Mountain") == true) as DataGridComboBoxColumn;
|
||||
if (comboBoxColumn != null)
|
||||
|
@ -111,6 +112,15 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
}
|
||||
}
|
||||
|
||||
private void DataGrid_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
|
||||
{
|
||||
if (e.Column is DataGridTemplateColumn column && (string)column?.Tag == "First_ascent" &&
|
||||
e.EditingElement is CalendarDatePicker calendar)
|
||||
{
|
||||
calendar.IsCalendarOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGrid_LoadingRowGroup(object sender, DataGridRowGroupHeaderEventArgs e)
|
||||
{
|
||||
ICollectionViewGroup group = e.RowGroupHeader.CollectionViewGroup;
|
||||
|
|
Загрузка…
Ссылка в новой задаче