I've got a XamDataGrid bound to some view models using MVVM. In our scenario, we only ever want a single row selected. We're using all the obvious stuff like SelectionTypeRecord="Single", etc.
I've even gone so far as to hook into the dependency property callback for when the datasource for the list changes, or when the current selection changes. The idea being that at that point I can explicitly remove any lingering selections by clearing out the SelectedItems collection in the control code behind and stuff.
Unfortunately, this does not work. Even with the following code:
foreach (var selectedItem in xamDataGrid.Records)
{ selectedItem.IsSelected = false; }
I can step through the debugger and look at the offending rows that aren't letting go of the selection. When you get to one of those rows, "IsSelected" will be true. After explicitly setting it to false, it will remain true.
Anyone have any ideas about what would be preventing SelectedItems from letting go of their selections?
Any ideas would be greatly appreciated.
Hi,
I'm experiencing maybe the same problem. I have a xamDataGrid with unbound fields and bound fields. RecordSelectionMode is set to single, MaxSelectedRecords is set to 1.
As long as records are selected using the bound fields, everything is ok. But if you select a row by clicking on one of the unbound columns, this row stays selected when selecting another row clicking on a bound field. Only when you click on an unbound field in another record, only the new record is selected.
I attached a sample Project where this problem can be reproduced. IG Version used is 12.2.20122.2089
Thanks
Markus
I seem to be getting slightly more meaningful responses over in this thread: http://es.infragistics.com/community/forums/p/73478/372191.aspx#372191
I have some more elaboration on what we've seen over there.
But by all means feel free to join in on the discussion, cause this is definitely the worst issue we've had with the grid.
Yes. We definitely tried this first, and it didn't work.
That's why I had to go out of my way to be even more explicit.
For example, what we're seeing is that you can clear the SelectedItems list, and still have items for which IsSelected is still true. That's why we ended up looping through the entire Records collection to get rid of this issue.
We're using Netvantage 11.2, by the way.