This project has moved and is read-only. For the latest updates, please go here.

MapItemsControl.WPF.cs - selectedItems property

May 31, 2013 at 3:14 PM
Edited May 31, 2013 at 3:26 PM
Hi Clemens

I have a datagrid and MapItemsControl bound to the same ICollectionView. The grid displaying a list of road names and the MapItemsControl displaying polylines.

When I click through the datagrid the related polyline also becomes selected - that's great.

Why I'm trying to do now is select multiple roads from the datagrid and have the multiple related polylines become selected too - but I see the WPF MapItemsControl doesn't support 'selectedItems', although the c# MapItemsControl version does as it inherits from ListBox.

Any ideas how I could go about this?

Many thanks
May 31, 2013 at 4:07 PM
I guess you would also have to set the SelectionMode property to Extended.
May 31, 2013 at 4:20 PM
Yes, I've done that for both the datagrid and the MapItemsControl
May 31, 2013 at 5:57 PM
Actually DataGrid doesn't seem to have a SelectedItems property. So how are you going to keep the DataGrid's selected items and those of the MapItemsControl in sync? At least that's not anything a collection view will do.
Jun 3, 2013 at 1:40 PM
Yes, you're right. There was more to the basics of my code than I expected.

Worked my way around the requirement using this method:

Thanks again for the reply as always Clemens.