This is a migrated thread and some comments may be shown as answers.

Using RadCharts on a dynamic layer

2 Answers 65 Views
Map
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 16 Nov 2010, 04:55 PM
Hi,

I have defined a dynamic layer, and I am trying to deliver up RadCharts.  As per your examples, I set the MapLayer Location Property on the RadChart.

If I add the charts directly to an InformationLayer, then they work
If I add them on the dynamic layer I get the following exception

Specified index is out of range or child at index is null. Do not call this method if VisualChildrenCount returns zero, indicating that the Visual has no children.\r\nParameter name: index\r\nActual value was 0.

   at System.Windows.FrameworkElement.GetVisualChild(Int32 index)\r\n   at System.Windows.Media.Visual.InternalGet2DOr3DVisualChild(Int32 index)\r\n   at System.Windows.Media.VisualTreeHelper.GetChild(DependencyObject reference, Int32 childIndex)\r\n   at Telerik.Windows.Controls.RadChart.PopulateLogicalChildren()\r\n   at Telerik.Windows.Controls.RadChart.OnApplyTemplate()\r\n   at Telerik.Windows.Controls.Map.DynamicLayer.MapSquares.CheckVisibility()\r\n   at Telerik.Windows.Controls.Map.DynamicLayer.RequestSlices(Int32 matrixIndex)\r\n   at Telerik.Windows.Controls.Map.DynamicLayer.ProcessRequests()

Is there something that I am not doing properly.

Thanks
Simon

2 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 18 Nov 2010, 04:57 PM
Hi Simon,

Thank you for the feedback.
There is a peculiarity of using RadChart with DynamicLayer. You should add it to a simple container like Grid.
RadChart chart = new RadChart();
// chart initialization
// ...

Grid grid =
new Grid();
grid.Children.Add(chart);

Location location =
new Location(42.866667, 25.333333);
MapLayer.SetLocation(grid, location);

Then by items request you can use this Grid element instead of RadChart.

All the best,
Andrey Murzov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Simon
Top achievements
Rank 1
answered on 19 Nov 2010, 01:23 PM
Thanks, in the end I created a new control that contained a RadMap and that works just fine
Tags
Map
Asked by
Simon
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Simon
Top achievements
Rank 1
Share this question
or