Drag/Drop RadChart.DataSeries

9 posts, 2 answers
  1. Dan
    Dan avatar
    11 posts
    Member since:
    Mar 2009

    Posted 10 Jul 2009 Link to this post

    I have an application that has 2 charts, where each chart definition is "StackedBarSeriesDefinition". 

    What I would like to be able to do is drag one of the dataseries from one chart to the other chart, and vice versa.  Is this possible?

    Thanks,
    Dan
  2. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 14 Jul 2009 Link to this post

    Hello Dan,

    I am attaching an example application where I have implemented DragDrop between two charts. Is this what you needed? The example shows how this is done with 2 Charts, but you can easily see how this can be done for more.

    Here is a screen:




    On a side note, I could not think of a scenario where this kind of DragDrop can be used. Could you please share what scenario does this support?

    Kind regards,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Dan
    Dan avatar
    11 posts
    Member since:
    Mar 2009

    Posted 28 Jul 2009 Link to this post

    Extremely helpful.  I really appreciate including the sample solution as well.  Much appreciated!

    Dan
  5. Dan
    Dan avatar
    11 posts
    Member since:
    Mar 2009

    Posted 28 Jul 2009 Link to this post

    I attached zip code works great, but i when i changed my references to point to the "RadControls for Silverlight Q1 2009" assemblies, the code will not compile.

    The following code will not compile:

     

     

    RadDragAndDropManager.AddDragQueryHandler(leftChart, OnDragQuery);

     

     

    RadDragAndDropManager.AddDragInfoHandler(leftChart, OnDragInfo);

     

     

    RadDragAndDropManager.AddDragQueryHandler(rightChart, OnDragQuery);

     

     

    RadDragAndDropManager.AddDragInfoHandler(rightChart, OnDragInfo);

    I searched the forums on "AddDragQueryHandle" looking for a suggested work around and could not find anything.  any suggestions?

    Thanks,
    Dan

     

  6. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 29 Jul 2009 Link to this post

    Hello Dan,

    Yes, there is an easy workaround. These static methods were added to DragDrop with the port to WPF because this is a standard pattern  in WPF when creating routed events and they also appeared in Silverlight for code compatibility.

    In SL and in WPF you can replace it with the following equivalent:

    leftChart.AddHandler(RadDragAndDropManager.DragQueryEvent, new
    EventHandler<DragDropQueryEventArgs>(OnDragQuery));

    Similarly for the other events. Just make sure that you have this using, because AddHandler is an extension method:

    using Telerik.Windows;

    Do come back to us if you have more questions or feedback,
    All the best,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Dan
    Dan avatar
    11 posts
    Member since:
    Mar 2009

    Posted 29 Jul 2009 Link to this post

    Thanks, worked great.
  8. Carlos Sesma
    Carlos Sesma avatar
    29 posts
    Member since:
    Dec 2008

    Posted 26 Oct 2010 Link to this post

    I'd like to see an example of this drag drop functionality in combination with a chart using a list as datasource like this example
    205794_stackedbarchart
    could you please give some advice on how to accomplish this please?

    in my case i need at least 2 charts having multiple series. and every time i try to enable dragdrop it does not work. the series just dont drag.

    regards.


  9. Carlos Sesma
    Carlos Sesma avatar
    29 posts
    Member since:
    Dec 2008

    Posted 26 Oct 2010 Link to this post

    I figured it out by my self, thank you.
  10. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 01 Jul 2012 Link to this post

    How to drag the line in  the chart?not two chart,just one chart!
Back to Top
DevCraft banner