Overriding TreeViewDragCue class

2 posts, 0 answers
  1. Paul Brun
    Paul Brun avatar
    41 posts
    Member since:
    May 2010

    Posted 14 Jul 2010 Link to this post

    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
  2. Paul Brun
    Paul Brun avatar
    41 posts
    Member since:
    May 2010

    Posted 15 Jul 2010 Link to this post

    it appears I have yet again resolved my own issue.

    Paul
  3. DevCraft banner
Back to Top