Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DragAndDrop > DragStatus always DragImpossible on RadGridView Header Cell

Answered DragStatus always DragImpossible on RadGridView Header Cell

Feed from this thread
  • Dave Baumann avatar

    Posted on Feb 9, 2012 (permalink)

    After updating the Telerik RadControls for Silverlight to version 2011.3.1116.1040 we have found a problem with using the RadDragAndDropManager with the RadGridView. We have a scenario where we drag and drop items between two RadGridViews.  We are no longer able to drop items onto the Header Row of the RadGridView. The e.Options.Status in the OnDropInfo handler always returns DragStatus.DropImpossible. It looks like the source RadGridView is the only element firing the Drop Event and the target RadGridView is not firing the drop event at all.

    This worked prior to updating the controls to the version noted above.

    In our target OnDropQuery and OnDropInfo hanlders we added to following lines of code to allow the user to drop an item onto the header row of the RadGridView. It is now never being called.

        if (target is Telerik.Windows.Controls.GridView.GridViewHeaderCell)
                {
                    gridview = ((GridViewHeaderCell)target).ParentRow.GridViewDataControl as RadGridView;
                }

    The challenge is that when we have an empty RadGridView, we have no target to drop to.

    Reply

  • Answer Nik Nik admin's avatar

    Posted on Feb 10, 2012 (permalink)

    Hello Dave,

    How exactly have you realized the DragAndDrop scenario? Mind that the Header Row cells handle the drag and drop events, so you will have to add the handlers with handledEventsToo set to true.

    this.GridView.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDragQuery), true);
                this.GridView.AddHandler(RadDragAndDropManager.DragInfoEvent, new EventHandler<DragDropEventArgs>(OnDragInfo), true);
                this.GridView.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDropQuery), true);
                this.GridView.AddHandler(RadDragAndDropManager.DropInfoEvent, new EventHandler<DragDropEventArgs>(OnDropInfo), true);

    I am attaching a small project demonstrating how you can achieve the desired functionality.

    Hope this helps!

    All the best,
    Nik
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Dave Baumann avatar

    Posted on Feb 10, 2012 (permalink)

    Thanks for the reply Nik.

    Unfortunately my target RadGridViews are contained in a ListBox. On the left hand side I have a RadGridView of Unassigned work items, the Unassigned Queue. On the right-hand side I have a ListBox of Queues for users. The DataTemplate for those Queues is a RadGridView. Because the target RadGridViews are contained in a DataTemplate I cannot reference those RadGridViews by name in the code behind.

    Here is how I am registering the DropHandlers at the page level in the code behind.

         RadDragAndDropManager.AddDragQueryHandler(this, OnDragQuery);
                RadDragAndDropManager.AddDragInfoHandler(this, OnDragInfo);
                RadDragAndDropManager.AddDropQueryHandler(this, OnDropQuery);
                RadDragAndDropManager.AddDropInfoHandler(this, OnDropInfo);

    The code that checks the GridViewHeaderRow in the original post works with the .dlls you reference in your project.

    However, I changed the event bindings wiring them up to the standalone GridView and also to the parent ListBox containing the DataTemplate GridViews as in your example and the event handlers now work again as expected.

    Thanks,

    Dave

    Reply

  • Brandon avatar

    Posted 1 day ago (permalink)

    I am trying to implement something similar.  I have child grids that I want to drop on as well - and the header cells (of the parent and child grids) always have DragStatus.DropImpossible - even after I set all of the AllowDrop properties on the header cells and header row to true.  Any ideas?

    Thanks!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DragAndDrop > DragStatus always DragImpossible on RadGridView Header Cell
Related resources for "DragStatus always DragImpossible on RadGridView Header Cell"

Silverlight DragAndDrop Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]