What I really want to do is this:
I am changing a free-text-field to a categorized field. The categories are objects of a custom class, that I made (ie not a string). I do not want to force my users to select a category on old objects. However, if they want to give a category, they must not be able to select null (also, new objects has null as the SelectedCategory). So I have the old string property and a new SelectedCategory property on my class. On old object SelectedCategory is null - which is good.
However in GridViewComboBoxColumn - since I do have null in the ItemsSource, the first category in the ItemsSource gets selected automatically when the ViewModel provides null as the selected category to the column.
So I try to bypass this behaviour by inserting null in ItemsSource - but then I need to Collapse the item with the value null so that it becomes invisible to the user.
But there are no GridViewComboBoxColumn.ItemsStyleHow do I do this?
I do not want to make a validation rule - because I do not want the old objects without a selected category to flash red.
I do not want to have the null value on the userinterface for the user to select and then give him an error that he cannot select it anyway.