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

[Solved] Drag tooltip picture

14 Answers 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Steve
Top achievements
Rank 1
Steve asked on 03 Oct 2010, 05:01 AM
I have implemented a form whereby user can drag items from a RadTreeView onto a GridView. All works OK except the little "No Parking" picture persists, implying to users that they cannot drop the item on the grid. Any suggestions?

(I am not sure what else to call this icon - see attached picture.)

14 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 04 Oct 2010, 08:25 AM
Hello Steve,

You can control this icon visibility by IsDropPossible property of the TreeViewDragCue. To set it while drag is performed you can attach to RadDragAndDropManager events (dragquery/info, dropquery/info) to the treeview and get the TreeViewDragCue from e.Options.DragCue.

Let me know if you need any further assistance.

Greetings,
Tsvyatko
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
0
Steve
Top achievements
Rank 1
answered on 04 Oct 2010, 09:20 AM
Hi Tsvyatko,

Thanks for the prompt response.

I am not sure I understand how to do what you suggest. I tried something like

var cue = new TreeViewDragCue;
cue.visibility = collapsed;
e.Options.DragCue = cue;

but TreeViewDragCue does not exist. Do I need another "using" statement?

For the avoidance of doubt I have posted another image - this shows the "No Parking sign" as well as the rest of the stuff that gets dragged around - I don't know the technical name. I want the red symbol to disappear when I am dragging over places where I am allowed to drop, but not the "Coca Cola 2010" text.
0
Tsvyatko
Telerik team
answered on 04 Oct 2010, 09:42 AM
Hello Steve,

I have prepared simple application illustrating the idea mentioned before. Basically, I have attached To DragInfo Handler and set DragCue to show drop possible in all cases. You can modify the logic in the Drag info to fit your scenario.

Please have a look at attachment and let me know if you need any further assistance.

Sincerely yours,
Tsvyatko
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
0
Steve
Top achievements
Rank 1
answered on 04 Oct 2010, 10:18 AM
A partial success. Now I see an orange arrow, not the No Parking. But how do I display the No Parking when I am dragging over somewhere I am not allowed to drop?
0
Tsvyatko
Telerik team
answered on 04 Oct 2010, 10:31 AM
Hello Steve,

As I have pointed in the initial post, you can control this icon visibility using the IsDropPossible property. In the example I have sent I set it to true always. However, when the drop is not possible you can set IsDropPossible to false and this will show the icon.

Let me know if you have any further issues.

Kind regards,
Tsvyatko
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
0
Steve
Top achievements
Rank 1
answered on 04 Oct 2010, 11:04 AM
As you say, in your example it is always true - so I guess my question is how do I test if I can drop or not? In my case I've got a grid where I can drop, but a ribbon where I can't. How do I detect in the

RadTreeView_DragInfo

routine what object I am dragging over?
 
I have tried sender, e.Source and e.OriginalSource but none seem to work.

(Sorry if my questions are a bit basic but I have only been doing Silverlight a week!)
0
Tsvyatko
Telerik team
answered on 04 Oct 2010, 12:47 PM
Hello Steve,

You can achieve this functionality by adding drop query handler to the element (or any of its parent) that control the icon visibility. I have modified the sample by adding RadGridView which does not allow drop. You can also get any UI element under the mouse using this code snippet:
var element = e.GetElement<DesiredElementType>(e.Options.CurrentDragPoint);

In addition I can recommend these resources for more information:
http://www.telerik.com/help/silverlight/raddraganddrop-events-overview.html
http://www.telerik.com/help/silverlight/raddraganddrop-getting-started-with-drag-and-drop.html

Let me know if you have any other questions or issues.

Best wishes,
Tsvyatko
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
0
Steve
Top achievements
Rank 1
answered on 05 Oct 2010, 07:53 AM
I am getting closer. It now works more or less as I require, except that the user can drag and drop items WITHIN my treelist - I do not want them to be able to do this.

So to recap, what I want is for user to drag FROM the TreeList TO the grid, but not FROM the TreeList to somewhere ELSE on the TreeGrid. Setting AllowDrop="False" and/or RadDragAndDropManager.AllowDrop="False"does not prevent this behaviour. I have tried to trap the drop using a DragDropQuery event but it doesn't seem to fire when mouse is over the TreeList

Any ideas?
0
Tsvyatko
Telerik team
answered on 05 Oct 2010, 08:33 AM
Hi Steve,

I have modified the sample project to fit the requirements. In this scenario the build in drag/drop behavior need to be disabled and we need to handle it manually. Please, have a look at the example and let me know if you need any further assistance.

Sincerely yours,
Tsvyatko
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
0
Steve
Top achievements
Rank 1
answered on 06 Oct 2010, 01:40 AM
So that I can tell what is happening on the TreeView, I overrode ToString for User thus:
 

 

 

public override string ToString()

 

{

 

 

    return userName;

 

}


I can now clearly see that it is STILL allowing me to move, say, User 14 to before User 2. I also see the orange arrow when I am dragging over the TreeView, plus a long orange line. (See attached picture).

Maybe I am using the wrong control. I just want a list I can drag FROM but NOT move the items around internally.
0
Pavel Pavlov
Telerik team
answered on 11 Oct 2010, 02:13 PM
Hi Steve,

Lets address the problems one by one :

1. To remove the orange line between items :
please set IsDropPreviewLineEnabled="False" on the TreeListView

2. To remove the arrow
IsDragTooltipEnabled="False" 




In case this does not solve the problems ,
I may prepare a sample for you with a regular listbox ( in case you really do not neeed the tree functionality and need just a regular listbox.)









All the best,
Pavel Pavlov
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
0
Steve
Top achievements
Rank 1
answered on 12 Oct 2010, 12:35 AM
Hi Pavel,
Imagine a list of animals. I might have them grouped by species, and alphabetically within species, like this:

Dogs
    Alsation
    Poodle
Cats
    Manx
    Siamese

which is why I put them on a treeview, so I can expand and collapse the groups. Can I achieve the same thing with a listbox?

Now it obviously makes no sense at all to allow the user to drag "Manx" into Dogs, and I cannot see much point letting them rearrange the order within each species group, but I want to allow them to drag either individual animals OR a whole group (say, all dogs) to another control.

I have got the icons working satisfactorily, I just need to prevent intra-treeview dragging.
0
Steve
Top achievements
Rank 1
answered on 12 Oct 2010, 11:50 PM
Hi guys,
Thganks for all your help. Tina's post here:

http://www.telerik.com/community/forums/silverlight/general-discussions/radtreeview-dropping-on-itself.aspx

has sorted me out.
0
Pavel Pavlov
Telerik team
answered on 14 Oct 2010, 11:46 AM
Hello Steve,

Nice to hear that you have sorted it out. Do not hesitate to contact us if you have further troubles.

Best wishes,
Pavel Pavlov
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
Tags
GridView
Asked by
Steve
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Steve
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or