DataBinding markers

Topics: WPF
Mar 3, 2011 at 11:01 AM
Edited Mar 3, 2011 at 11:22 AM

Hi all,

First of all, thanks for your great control, Radioman !

I try to databind markers to a datatable that contains lat and lng columns. How can I do this? Is somebody can post a code sample? I have read all discussions and search in the demo code, but no answer ...

Thank you.

Coordinator
Mar 3, 2011 at 12:01 PM

if you use ObservableCollection just set map.ItemSource to it

Mar 8, 2011 at 12:32 PM

Thanks for your quick answer.

OK, now, I have an ObservableCollection databinded on the map and the datagrid but when I sort data with the datagrid (with a click on the col header), all markers disappear!

Any idea ?

Mar 9, 2011 at 1:33 PM
Edited Mar 9, 2011 at 1:53 PM

Solved with this :

Map.ItemsSource = from item in MarkersList select item;
DataGrid.DataContext = MarkersList;

where MarkersList is ObservableCollection.

Coordinator
Mar 9, 2011 at 4:31 PM

nice!