Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: Wpf DataGridControl + ComboBox editor in a column - how to clear the value?

$
0
0
Hi,

I am using Extended WPF Toolkit 2.0.0 and the DataGridControl. One of columns in the grid uses ComboBox as the cell editor (set up using Column.CellEditor). The Column is bound to a navigational property which can be null. The ComboBox's list of items is bound to a collection on ViewModel. It all displays and edits fine.

However, I cannot work out how to clear the value in the cell "properly". The cell can be empty, but the collection of items in the combo does not contain a "blank" value. Once I set the value in the cell, I cannot clear it. I have added a button next to the ComboBox in the cell to clear the property on the item bound to the row in the grid. It kind of works, but I have to save the changes and then refresh the grid to see that there is no value in the cell. I tried refreshing the ComboBox somehow, and the cell itself, calling OnPropertyChange, but no success.

I cannot add "null" to the list of items in the combobox - it fails then.

What is the "proper" way to do it? Clearing the cell's value when the editor is a ComboBox...?

Viewing all articles
Browse latest Browse all 2157

Trending Articles



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