I am able to drop TreeView Items onto my RadCharts succesfully. My question is around dropping the items to a specific DataPoint in the Chart. For example, if I have a BarSeries RadChart with 3 columns(datapoints) if I drag and drop the TreeView item over column #2 am I able to realize that the drop happened on column #2 and not just on the ChartArea in General?
4 Answers, 1 is accepted
Yes, this is possible with our RadDragAndDropManager. You will need to set RadDragAndDropManager.AllowDrop property to true for Bar. You can use styles for this:
And make sure this style is applied:
Now set e.QueryResult to true in DropQuery event handler and you will be able to retrieve the Bar instance in the DropInfo event handler through e.Options.Destination. You can find more details about RadDragAndDropManager in this help topic.
the Telerik team
Do you have an idea, wath´s wrong with our code?
We are using the WPF RadChart, Version 2011.2.712.40 of the Telerik.Windows.Controls.Charting.dll.
In your answer in the previous post you talked only about finding the DataSeries, but the task is, to drop on a DataPoint. Please can you explain this in more detail?
The style, set to ItemStyle property of the BarSeriesDefinition will be applied to every Bar item in the series, so basically it covers this requirement -- the item will be dropped on a datapoint (bar in this example). Can you send us a small example, which reproduces the problem you are getting? This way we will be able to debug it locally and get back to you with our findings.
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
we support configurable charttypes, so we like to set the drop capability for all types at once.
Our solution is now:
It may look a little strange, to do this in the CreateItemStyleDelegate, but it works. We don´t find any other possibility to get the instances of type BaseChartItem etc.