Last Updated: 08 Oct 2014 14:34 by ADMIN
Created on: 02 Oct 2014 21:19
Category: ListBox
Type: Bug Report
Error binding visualizationlayer to itemssource listbox
Currently I´m testing the latest versión of Telerik Silverlight and the RadListBox control is crashing when binding VisualizationLayer items from RadMap control. It doesn´t show error information, the screen is withe.
This is the code I´m using:


    <converters:ItemsMapToLayerStringConverter  x:Key="ItemsMapToLayerStringConverter" />
    <RowDefinition Height="*"/>
    <RowDefinition Height="Auto"/>
  <telerik:RadMap x:Name="Map">
      <telerik:OpenStreetMapProvider />
  <telerik:RadListBox ItemsSource="{Binding ElementName=Map, Path=Items, Converter={StaticResource ItemsMapToLayerStringConverter}}" Gid.Row="1" >
        <TextBlock Text="{Binding Tag}"/>


public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  var mapa = value as RadMap;
  var capas = mapa.ChildrenOfType<VisualizationLayer>().ToList();
  return capas;
1 comment
Posted on: 08 Oct 2014 14:34
The code inside the converter does not seem correct - you're binding to the Items property of the RadMap, but in the converter try to cast it to the Map itself. 

There is no need to have a converter actually, the binding should work directly:
 <telerik:RadListBox ItemsSource="{Binding ElementName=Map, Path=Items}" ...>
as the Items of the RadMap are the VisualizationLayers.

If you still experience the issue, please send us a support ticket with more details on the exact requirement.