User (Old forums)MemberMay 5, 2008 at 9:24 amPost count: 23064
I posted this in another thread (http://xceed.com/CS/forums/thread/7462.aspx), but haven’t received a response. Therefore, I’ll repost it here.
I’m trying to get notification when the SelectedItems property has changed. I’d prefer a SelectionChanged event, as Microsoft provides on their WPF ListView and on their Silverlight DataGrid. However, it doesn’t exist in the Xceed DataGrid.
In this thread(http://xceed.com/CS/forums/thread/7462.aspx), it says I should register for change notifications for the SelectedItem Dependency property. This works great for single selection, but not for multi-select datagrids.
I have a DataGrid with SelectionMode set to SelectionMode.Extended. I have registered a change notification for the SelectedItems dependency property. When selecting multiple items using the Ctrl-Shift key, no change notification event is fired, even though the SelectedItems.Count property has increased.
Can anyone suggest a better way to do this? Is there something wrong with the code I’m using?
Here is my code:
DependencyPropertyDescriptor SelectedItemsChangedDescriptor =
private void OnSelectedItemsChanged(object sender, EventArgs e)
// Do something with this event
Imported from legacy forums. Posted by Todd (had 3498 views)Xceed SupportMemberMay 5, 2008 at 9:38 amPost count: 5658
We did see your first post, but couldn’t respond at the moment. Thank you for your patience.
We noted your suggestion regarding the selection changed event. At the moment, you can receive notification regarding the selected items by using this little trick:
INotifyCollectionChanged selectedItems = grid1.SelectedItems as INotifyCollectionChanged;
selectedItems.CollectionChanged += myHandler;
Imported from legacy forums. Posted by Marcus [Xceed] (had 1661 views)User (Old forums)MemberMay 5, 2008 at 9:44 amPost count: 23064
Thanks! I’ll give this a try.
Imported from legacy forums. Posted by Todd (had 720 views)User (Old forums)MemberMay 5, 2008 at 11:18 amPost count: 23064
That worked great! Thanks again.
Imported from legacy forums. Posted by Todd (had 694 views)User (Old forums)MemberMarch 10, 2009 at 1:17 pmPost count: 23064
Is there a response to this issue yet?
It seems that although the dependency property exists, it is not thrown at present.
Imported from legacy forums. Posted by Jeffrey (had 3446 views)User (Old forums)MemberMarch 18, 2009 at 7:01 amPost count: 23064
I am having problem with this change notification as well. It was working before but now the notification is not fired.
Is this a bug?
Imported from legacy forums. Posted by Serene (had 419 views)
- You must be logged in to reply to this topic.