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

Unable to drag GridViewHeaderCell from RadGridView

2 Answers 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 02 Dec 2013, 07:07 PM

Hello,

We have recently upgraded our telerik dll's and discovered a problem with drag and drop.  Our application would allow users to drag the GridViewHeaderCell to an area which would let them build charts based on that column.

We were using RadDragAndDropManager and realised that it is unsupported, so I have attempted to move to the new DragDropManager but it does not work either.

We have created a control called "DraggableControl" which we place into the GridViewHeaderCell.  We can see the control getting instantiated, and the drag events set, but when we physically drag it, the events are never fired.  Our control template looks like this.  As you can see we are setting the AllowDrag property which should mean we can drag this object?

Any ideas as to what is wrong?  Is it possible to drag a grid view column header to somewhere outside the grid?

<Style TargetType="controls:DraggableObject">
    <Setter Property="Telerik_Windows_Controls_DragDrop:RadDragAndDropManager.AllowDrag" Value="True" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="controls:DraggableObject">
                <Grid Background="Pink" x:Name="xxx">
                    <ContentPresenter Content="{Binding}">
                    </ContentPresenter>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

2 Answers, 1 is accepted

Sort by
0
Rob
Top achievements
Rank 1
answered on 02 Dec 2013, 08:47 PM
UPDATE:  I've managed to handle OnDrop in the drop area and the payload seems to have automatically been loaded by the radgridview.  I have pulled the payload object "HeaderCell" and can work with that...



Unfortunately, I'm still not getting any feedback events so I'm unable to manipulate the cursors while dragging.  Any ideas on what I'm missing?
0
Nick
Telerik team
answered on 05 Dec 2013, 09:19 AM
Hello Rob,

It is possible to Drag a Column Header out of the Grid View, you just have to subscripe to the Drag Events with handled events too set to true since the GridView handles the events internally and you won't get the handlers fired otherwise. 

let me know if that helps! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Rob
Top achievements
Rank 1
Answers by
Rob
Top achievements
Rank 1
Nick
Telerik team
Share this question
or