Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to add items to an already bound DataGridComboxBoxColumn

$
0
0

Hi everyone, I have a datagrid with a DataGridComboxBoxColumn and which is bound to an ObservableCollection<UnitModel>. Now I used a styleto make the combobox column editable:

<Style x:Key="EditableDataGridComboBoxColumnStyle" TargetType="ComboBox"><Setter Property="IsEditable" Value="True"/></Style>

Now the combox is editable. But when I type in text and press enter, the typed text won't get added to the combobox (and also won't display). How do I add the typed text to the collection so I can select it in other rows? DataGridTemplateColumn with combobox is welcome too, as long as I am able to achieve this feature. Thank you for the help.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>