Changing DragCue mid-drag

15 posts, 0 answers
  1. Andrew
    Andrew avatar
    26 posts
    Member since:
    Apr 2009

    Posted 29 Apr 2009 Link to this post

    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?
  2. Andrew
    Andrew avatar
    26 posts
    Member since:
    Apr 2009

    Posted 30 Apr 2009 Link to this post

    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.
  3. DevCraft banner
  4. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 01 May 2009 Link to this post

    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.
  5. Sam
    Sam avatar
    19 posts
    Member since:
    May 2009

    Posted 08 May 2009 Link to this post

    Hi Miroslav,

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

    Thanks

    Sam
  6. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 08 May 2009 Link to this post

    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.
  7. Sam
    Sam avatar
    19 posts
    Member since:
    May 2009

    Posted 08 May 2009 Link to this post

    Hi Miroslav,

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

    Sam
  8. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 08 May 2009 Link to this post

    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
  9. Miroslav Paskov
    Miroslav Paskov avatar
    6 posts
    Member since:
    Oct 2007

    Posted 11 May 2009 Link to this post

    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 

  10. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 11 May 2009 Link to this post

    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
  11. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 11 May 2009 Link to this post

    Hello,

    in addition to previous post:

    context menu is on Control LeftMouseDown

    thx, piet
  12. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 11 May 2009 Link to this post

    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 ?
  13. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 13 May 2009 Link to this post

    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.
  14. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 13 May 2009 Link to this post

    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.
  15. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 14 May 2009 Link to this post

    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
  16. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 18 May 2009 Link to this post

    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.
Back to Top
DevCraft banner