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

Changing DragCue mid-drag

14 Answers 331 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 30 Apr 2009, 12:47 AM
Hi,


I am implementing the ability to drag from one GridView to another and want to give feedback to the user about whether the drag can be successful or not

I have created two DataTemplates, for example a tick and a cross, which should be displayed respectively under the DragInfo events when the DragStatus is DropPossible and DropImpossible

I am able to change the ArrowCue background colour mid-drag with regard to the status, but attempting to replace the DragCue mid-drag doesn't appear to work.

To test my theory, I set the DragCue to a simple rectangle on the DragQuery event

Then, as the following code shows, I attempted to clear any possible visualisations under either DragStatus on the DragInfo event

            if (e.Options.Status == DragStatus.DropPossible) 
            {                 
                e.Options.ArrowCue = null
                e.Options.SourceCue = null
                e.Options.DestinationCue = null
                e.Options.DragCue = null
            } 
 
            if (e.Options.Status == DragStatus.DropImpossible) 
            {                 
                e.Options.ArrowCue = null
                e.Options.SourceCue = null
                e.Options.DestinationCue = null;  
                e.Options.DragCue = null
            } 

The arrow stops moving but still appears on the screen after the event is called. The DragCue still appears as a rectangle and is not cleared

Is this a limitation or am I doing something wrong?

14 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 30 Apr 2009, 06:29 AM
Additionally, if you could provide sample code whenever you have time that uses SourceCue, SourceCueHost, DestinationCue and DestinationCueHost that would be appreciated. I tried looking through the examples but couldn't find any code that had used it

From my understanding of the API, I tried setting SourceCue + DestinationCue as a different ContentControl on DragQuery but didn't notice any visual difference.
0
Miroslav
Telerik team
answered on 01 May 2009, 02:36 PM

Hi Andrew,

I am sorry that I delayed the answer to your question, In the coming days (Monday/Tuesday) I will create a comprehensive DragDrop example with your questions in mind.

I will reply here and blog about it.

Greetings,

Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sam
Top achievements
Rank 1
answered on 08 May 2009, 08:32 AM
Hi Miroslav,

Is there any news on the sample project?  I too need to implement similar functionality to Andrew.

Thanks

Sam
0
Miroslav
Telerik team
answered on 08 May 2009, 08:50 AM
Hi Sam & Andrew,

I was trying to create a more realistic example and got into Reactive Programming patterns + the MVVM pattern. The sample application is coming out quite well. I still need to add more drag-drop functionality and document it, but you can have a sneak peek.

This week has been a little more hectic than expected, but I will do my best to finish this as soon as possible. The demo currently includes:

  • Dragging Multilple Items at once
  • Differentiated feedback for each dragged item (can/cannot perform drag operation)
  • Auto-expland/open for all expandable controls
  • Auto-scroll for the scrollbars
  • Custom drag action text
  • Custom drag action icon
  • Business rules expressed concisely, at most once
  • Strictly following MVVM architecture (you will notice that there is no business logic in the views and the views codebehind is mostly empty)

Andrew, I sorry that this takes a while but I hope that the result will be worth the wait and there will be a lot to learn from the example.

Please note that the example uses BinableLinq which is an external library with a BSD license,

http://bindablelinq.codeplex.com/license

There is no documentation yet so I feel obliged to mention this here.

I have run the app against the Latest Internal Build, ver. 1.0501.

Sincerely yours,

Miroslav
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sam
Top achievements
Rank 1
answered on 08 May 2009, 10:41 AM
Hi Miroslav,

Thanks for sneak preview, that gave me the answer I need.

Sam
0
Piet
Top achievements
Rank 1
answered on 08 May 2009, 02:16 PM
I am looking at the code and copied as much as i thought i needed.
all grids get their allow drag and drop property set at runtime.

I'm still trying to get the overview and the details while trying to get dragging and dropping of grid rows working.

ill let you know how its goes.

any upgrades on the sample appl. is highly appreciated.

thx piet
0
Miroslav Paskov
Top achievements
Rank 1
answered on 11 May 2009, 01:03 PM

Hi Piet,

 

Currently the GridView begins certain actions on MouseDown and not on MouseUp. This means that it will be difficult to implement a drag operation in such a case. We are looking into this and I will update the example once it is ready.

 

Greetings

Miroslav 

0
Piet
Top achievements
Rank 1
answered on 11 May 2009, 02:56 PM
Hello,

I am able to drag and drop GridViewRows, so thats nide.

Based on your MouseDown mentioned i think i have a related problem with a context menu not working for a GridViewRow
(the same context menu does work on a simple image.)

Do you have anything knowledge or direction on how to get a context menu working in a RadGridView with dragAndDrop enabled on it?

Regards, Piet
0
Piet
Top achievements
Rank 1
answered on 11 May 2009, 02:58 PM
Hello,

in addition to previous post:

context menu is on Control LeftMouseDown

thx, piet
0
Piet
Top achievements
Rank 1
answered on 11 May 2009, 03:45 PM
Hello,

Context menu on RadGridView works (even inside Docking pane)
The same Context menu on a GridViewRow of that grid does not work.
(event with Drag and Drop turned off completely)

Any advise on how to get a context menu and drag and drop working on GridViewRow ?

Regards Piet

ps seems that i'am stretching the controls ... during my proof of concept testing ?
0
Miroslav
Telerik team
answered on 13 May 2009, 07:16 AM
Hi All,

As promised, I am posting an updated version of the example.

Please note that it has not been documented yet. Also the bindable linq is included as a compiled dll rather than source code.

Your comments are welcome.

Kind regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Miroslav
Telerik team
answered on 13 May 2009, 07:35 AM
Hello Piet,

When I started the example, I was also surprised that most of the GridView actions happen on mouse down rather than mouse up. After a bit of searching it turned out that the MS grid and the competitor's grid controls also behave in this way.

Of course I am not so happy because of the hard time that I may have to show off the DragDrop (and normally it will be really easy to add drag-drop). We are discussing the possibilities here and I think that there should be an option to change the default select/edit behavior to be more windows-explorer-like.

As for the context menu: You may try to add it on right-mouse button. You need to set the application to windowless to get this working. This way you will not depend on the left mouse button or how it is handled.

A good approach to implementing the context menu will be to abstract all action as commands and then bind the Context menu. Thanks to the routing events, you can build up the context menu in a cascading-scope way. For simplicity many of our examples just create a Context menu declaratively, but this does not scale well.

Here is an example of a context menu implemented on right click:

http://demos.telerik.com/silverlight/#TreeView/AddRemoveDisable

Certainly our Silverlight controls are optimized for some scenarios more than for others but I know they are very flexible, close to the WPF experience. We are happy whenever we get feedback on what can be improved.

Kind regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Piet
Top achievements
Rank 1
answered on 14 May 2009, 08:39 PM
Hello Miroslav,

Context menu with right click now works on Windows.

Not on the mac i canot get anything working with right click or control left click (gives the small 'Silverlight preferences' popup)
The only thing working that gets close to giving the popup in ContextMenu/PopupMenu telerik demo is Alt or Shift or Apple MouseLeftButtonDown. (all keyboard modifiers with MouseRightButton give the silverl pref popup)
I downgrded to silverlight 2 after seeing this with the mac sl3 beta.
i am runnig apple safari version 4 public beta (5528.16)

any suggestions ?

question that pops up is how you are currently testing Mac/Mono for these things?

ps a colleage at another company would like to run the telerik demo on a linux browser. could you give directions ?

Regards, Piet
0
Tihomir Petkov
Telerik team
answered on 18 May 2009, 12:33 PM
Hi Piet,

First, I appologize for the delayed response. Within the next few days we will investigate in more depth the problem you are having with right mouse clicks on a Mac. We were unable to determine what causes the problem from our initial tests.

As for your question about testing - we have a Mac test machine.

Linux/Mono are not officially supported since currently the Linux version of the plugin is functionally equivalent to Silverlight 1.0 (the Silverlight 2.0 functionality is in a pre-alpha stage).

Best wishes,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
DragAndDrop
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Miroslav
Telerik team
Sam
Top achievements
Rank 1
Piet
Top achievements
Rank 1
Miroslav Paskov
Top achievements
Rank 1
Tihomir Petkov
Telerik team
Share this question
or