WPF Application
In datagrid,if I use DataGridComboBoxColumn to show Combobox,it is only show when I double click the cell enter edit status.
I want to show the combobox all the time, and don't need to double click the cell. How to do?
Replace the DataGridComboBoxColumn
with a DataGridTemplateColumn
and add a ComboBox
to its CellTemplate
and CellEditingTemplate
:
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox ItemsSource="..." />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox ItemsSource="..." />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>