DataBinding markers

Topics: WPF
Mar 3, 2011 at 12:01 PM
Edited Mar 3, 2011 at 12:22 PM

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.

Mar 3, 2011 at 1:01 PM

if you use ObservableCollection just set map.ItemSource to it

Mar 8, 2011 at 1: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 2:33 PM
Edited Mar 9, 2011 at 2:53 PM

Solved with this :

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

where MarkersList is ObservableCollection.

Mar 9, 2011 at 5:31 PM