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
From my understanding of the API, I tried setting SourceCue + DestinationCue as a different ContentControl on DragQuery but didn't notice any visual difference.
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,
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.
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,
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.
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
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
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.
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.
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
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.