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

Overriding TreeViewDragCue class

1 Answer 43 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Paul Brun
Top achievements
Rank 2
Paul Brun asked on 14 Jul 2010, 07:10 PM
For our project, we described to create a custom DragCue class that extends from TreeViewDragCue. Only purpose at this point was because of the name and for it to make sense from a development perspective. As an example, I created a class like this:

public class MyDragCue : TreeViewDragCue
{
    public MyDragCue ()
        : base()
    {
 
    }
}

I used it in my OnDragQuery event for my RadTreeView (using the RadDragAndDropManager) in the following fashion:

void OnDragQuery(object sender, DragDropQueryEventArgs e)
{      
    if (e.Options.Status == DragStatus.DragQuery)
    {
        e.Options.Payload = ctlSystemTreeView.SelectedItem;
 
        //Set up a drag cue
        MyDragCue cue = new MyDragCue();
        cue.ItemTemplate = ctlSystemTreeView.ItemTemplate;
        e.Options.DragCue = cue;
    }
    e.QueryResult = true;
    e.Handled = true;
}

however, when I do the following in my OnDropQuery event based on the TreeView, I end up getting a NULL value for the DragCue when I do the following:

MyDragCue cue = e.Options.DragCue as MyDragCue;

Yet, I have no problem, if I do the following: TreeViewDragCue cue = e.Options.DragCue as TreeViewDragCue;

Thoughts?

Paul

1 Answer, 1 is accepted

Sort by
0
Paul Brun
Top achievements
Rank 2
answered on 15 Jul 2010, 03:13 PM
it appears I have yet again resolved my own issue.

Paul
Tags
DragAndDrop
Asked by
Paul Brun
Top achievements
Rank 2
Answers by
Paul Brun
Top achievements
Rank 2
Share this question
or