using SelectedItem in SelectionMode="Single"?

Aug 29, 2008 at 11:42 AM
Edited Aug 29, 2008 at 11:44 AM
I have DataGrid with properties:





When I try add new row through DataGrid it throw exception:
"Kolekcję SelectedItems można zmienić tylko w trybie wielokrotnego wyboru. W trybie pojedynczego wyboru użyj SelectedItem."
Exception message is in polish. Here is my english translate:
"SelectedItems collection can be change only in SelectionMode="Extended". In SelectionMode="Single" use SelectedItem."

How I can set DataGrid to use SelectedItem instead of SelectedItems in SelectionMode="Single"?

PS. Yes I can change properties(set SelectionUnit="Cell" or set SelectionnMode="Extended") of my DataGrid to fix this, but I need this properties to be set as I wrote on the top.
Aug 29, 2008 at 2:30 PM
The is a known bug that will be addressed in the final release.
Aug 29, 2008 at 2:48 PM
Thanks for the answer. I can now write little workaround in my code ;)