Customize TreeViewDragCue

4 posts, 1 answers
  1. Randall Nelson
    Randall Nelson avatar
    25 posts
    Member since:
    Oct 2007

    Posted 10 Feb 2010 Link to this post

    My application allows for a drag from selected records in a RadGridView.  I am using the TreeViewDragCue to display the records that are being dragged, and it is working very nicely.  But I would like to make two changes to it. 

    First, I would like the DragToolTip to appear on the top rather than the bottom (when there are many records selected, this tool tip can disappear off the bottom of the screen). 

    Second, I would like to limit the number of records displayed (a user might select 100 records).

    Any ideas on how I can do this?
  2. Answer
    Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 12 Feb 2010 Link to this post

    Hello Randall,

    There is no handy way to make the DragCue be displayed above the mouse pointer. What you can do if you can somehow calculate the height of the DragCue, is to set negative top margin.

    As for restricting the number of records shown in the DragCue, I believe there should be no problem about that - after all you are the one who determines what, if anything, will be visible in the DragCue. Simply check for the number of records that is in the Payload and put only as many as you want in the DragCue.

    Best wishes,
    Tihomir Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Randall Nelson
    Randall Nelson avatar
    25 posts
    Member since:
    Oct 2007

    Posted 15 Feb 2010 Link to this post

    Thanks for the reply.  On limiting the number of records in the DragCue - I guess I could work it like this:

    * When OnDragQuery fires - fill the payload up with all the selected records.  Then put 5 or 10 of the records in a class list<> variable.
    * When OnDragInfo fires - assign this class list<> variable to the cue's itemsource rather than assigning the payload to the itemsource.

    Was that what you were thinking?
  5. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 17 Feb 2010 Link to this post

    Hello Randall,

    Well, you can do it in various ways, but - yes, what you described should work. The principle is the same - use the payload to carry the actual data and the drag cue to only give feedback to the user.

    All the best,
    Tihomir Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top