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 =
DependencyPropertyDescriptor.FromProperty(DataGridControl.SelectedItemsProperty,
typeof(DataGridControl));
SelectedItemsChangedDescriptor.AddValueChanged(myGrid,
new EventHandler(OnSelectedItemsChanged));
private void OnSelectedItemsChanged(object sender, EventArgs e)
{
// Do something with this event
}
------------------------------------------------------------------------------------------------------