DragDropManager XamDataGrid

Nov 16, 2008 at 8:14 PM
Hi All,

Is anyone using the DragDropManager with the XamDataGrid from Infragistics?

The problem I'm having is the DragDropManager handling events that should be passed onto the grid.  The grid has a GroupByArea that allows the grouping of records, the GroupByArea is expandable (not always shown basically) in my CrossAppAdvisor I have added a new IsDraggable method to take care of this which performs some HitTesting on the grid and conditionally I manually set the .IsExpanded property on the grid.  All good ...

However, once you have grouped records each group can be expanded so show the records in that group.  With the DragDropManager on a grid, a click on this expander simply evaluates the click as either Draggable/Not-Draggable and never passes this event onto the XamDataGrid in order to perform the expansion of that group. 

I've tried marking the event as e.Handled = false; in the DragDropManager class itself but this still isn't passing the event on.  I think due to it being a Direct event rather than bubbling or tunnelling.

            if (CurrentDragSourceAdvisor.IsDraggable((DependencyObject)sender, e) == false)
                e.Handled = false;

Has anyone worked around this or similar problems?  Any ideas would be great.
Nov 17, 2008 at 12:29 AM
     I am cross posting the reply that I put on my blog:

The DnD manager uses the PreviewMouse events to handle the DnD functionality. This is probably something that I’ll have to change in order to allow the app to process it. You could also check to see if there are other controls in the visual tree that may be intercepting the events. For example Button, ListBox are few controls that gobble up most of the Mouse events.
Nov 17, 2008 at 5:06 PM
Hi Pavan,

Sorry for double posting on here and your blog, and thanks for the reply.

I'm pretty sure that it is the DragDropManager that is causing the issue as when removing it from the grid all of the grids internal functionality returns to normal.

I've been looking through the Infragistics documentation in order to see what hit testing I can do to detect that certain things have been clicked on.

I'll report back when I find out anything useful.  If you do have any ideas let me know.

Maybe I can try a test and move away from the PreviewMouse events ... not sure I want to be hacking your lovely code around too much though!