Can't reject drag/drop moves in event handler

How does one reject a move from within the dragDrop event
handler? I cannot figure out how to do this.
I have dragMoveEnabled in the tree and I need to reject
certain attempts like moving a 'folder' node to a certain node
type.
I can easily detect any combination of things that would
constitute a rejection signal, but I can't seem to force the move
to be canceled. I'm handling copies myself within the dragDrop
handler, but I would like to let it do the moves for me since they
are pretty simple and don't require any extra processing. I just
need to cancel certain ones.
anyone try this?

update: changing the batteries on the wireless Logitech mouse slightly improved the situation--but not by much.
update 2: when I swap in an old corded one-button Apple mouse, the problem disappears, which places the blame squarely on the wireless mouse. I should have thought of doing this before posting in this forum, sorry.
Do wireless mice really lose it so abruptly like this? rats, I've gotten accustomed to those programmable buttons and the scroll wheel...

Similar Messages

  • How i can do a drag drop between container (grid)?

    I am trying to work out a task with Drag and Drop(WPF ,C#)to include in a demo ,i will explain easy showing an example of code in XAML 
    <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
    <RowDefinition Height="*"/>
    <RowDefinition Height="*"/>
    <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid x:Name="container1" Grid.Row="0" >
    <Grid Name="grid1" Background="Aqua" Margin="15"></Grid>
    </Grid>
    <Grid x:Name="container2" Grid.Row="1" >
    <Grid Name="grid2" Background="blue" Margin="15"></Grid>
    </Grid>
    <Grid x:Name="container3" Grid.Row="2" >
    <Grid Name="grid3" Background="green" Margin="15"></Grid>
    </Grid>
    </Grid>
    My purpose is when the user drag the
    grid1 in the
    container2 automatically the grid2 will go to place in the
    container1 (basically I want to swap the grids) then this process will be used every time need to drag a grid in a container. with a code that i wrote down i can do a simple drag&drop  i can drag the "grid1"
    to the "container2" but cannot send back automatically the grid2 to container1.
    Kindly i ask if you have any advise or tips to make successful this task.
    Thank you so much for your attention
    Cheers!!!
    *********EDIT*********                                                                  
                                     Using this code as follow i can do the drag&drop but what really i need is the grid "container "is fix and never move just the
    "grid" should move between the "container "                                 
    <StackPanel Name="sp" AllowDrop="True" Background="SkyBlue" PreviewMouseLeftButtonDown="sp_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="sp_PreviewMouseLeftButtonUp" PreviewMouseMove="sp_PreviewMouseMove"
    DragEnter="sp_DragEnter" Drop="sp_Drop">
    <Grid Name="grid1" Background="Aqua" Height="120" Width="500"></Grid>
    <Grid Name="grid2" Background="Blue" Height="120" Width="500"></Grid>
    <Grid Name="grid3" Background="Red" Height="120" Width="500"></Grid>
    </StackPanel>
    private bool _isDown;
    private bool _isDragging;
    private Point _startPoint;
    private UIElement _realDragSource;
    private UIElement _dummyDragSource = new UIElement();
    public MainWindow()
    InitializeComponent();
    private void sp_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    if (e.Source == this.sp)
    else
    _isDown = true;
    _startPoint = e.GetPosition(this.sp);
    private void sp_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    _isDown = false;
    _isDragging = false;
    _realDragSource.ReleaseMouseCapture();
    private void sp_PreviewMouseMove(object sender, MouseEventArgs e)
    if (_isDown)
    if ((_isDragging == false) && ((Math.Abs(e.GetPosition(this.sp).X - _startPoint.X) > SystemParameters.MinimumHorizontalDragDistance) ||
    (Math.Abs(e.GetPosition(this.sp).Y - _startPoint.Y) > SystemParameters.MinimumVerticalDragDistance)))
    _isDragging = true;
    _realDragSource = e.Source as UIElement;
    _realDragSource.CaptureMouse();
    DragDrop.DoDragDrop(_dummyDragSource, new DataObject("UIElement", e.Source, true), DragDropEffects.Move);
    private void sp_DragEnter(object sender, DragEventArgs e)
    if (e.Data.GetDataPresent("UIElement"))
    e.Effects = DragDropEffects.Move;
    private void sp_Drop(object sender, DragEventArgs e)
    if (e.Data.GetDataPresent("UIElement"))
    UIElement droptarget = e.Source as UIElement;
    int droptargetIndex=-1, i =0;
    foreach (UIElement element in this.sp.Children)
    if (element.Equals(droptarget))
    droptargetIndex = i;
    break;
    i++;
    if (droptargetIndex != -1)
    this.sp.Children.Remove(_realDragSource);
    this.sp.Children.Insert(droptargetIndex, _realDragSource);
    _isDown = false;
    _isDragging = false;
    _realDragSource.ReleaseMouseCapture();
    Thanks :)

    Hello Jonny,
    Currently I do not have a sample and I have reviewed this post and find another way which seems more reasonable. Have you cosidered use a ListView instead of common grid. It seems we can do what you want with two common grid however we need to hardcoded
    all the things.
    If we use ListView, for example, you can see this thread:
    http://stackoverflow.com/questions/20573063/creating-icon-view-mode-for-listview-wpf
    and this thread:
    http://stackoverflow.com/questions/9443695/how-do-i-drag-drop-items-in-the-same-listview
    We can drag and drop items instead of grid, which will make this programming much easier than hard code to switch your control's location.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.
    Dear Barry Wang thank you so much for your kind support ,just open me a way to do it ,you can see in this post https://social.msdn.microsoft.com/Forums/vstudio/en-US/55873851-e86c-4a20-9b00-de3419054ba8/get-stuck-to-dragdrop-in-this-case?forum=wpf .
    Wish you a Happy New Year .
    Sincerley

  • Can I just drag/drop files to the TC to back them up ?

    As it appears to be 'just' a hard drive, can I simply drag/drop any files I want to back up immediately, onto the TC and they will copy across ?
    Will this not affect the backup images ?

    Yes. The Time Capsule is indeed just a disk being served across the network with no special purpose. It is not dedicated to Time Machine (though that's probably what most people buy & use it for and it's certainly marketed for that purpose).
    If you were doing Time Machine backups to a local disk (e.g. Firewire or USB connected external drive) then you'd you'd see a folder for your computers backups with loads of folders inside named for the date & time of that backup. Those are all maintained by Time Machine. You can drop a file anywhere else in the drive (don't drop it inside the folders that Time Machine maintains).
    When using either Time Capsule or the newer Airport Extreme Base Station with the GigE & USB port for printer/disk support, Time Machine works just like a local disk except it encrypts the backup in a sparse image file (basically the same thing as 'FileVault') They key to encrypt/decrypt the data in the spare image is kept in your keychain. You can click your Time Capsule in Finder to mount it and you'll see the sparsebundle file(s). Your Time Machine backups are in the sparebundle files. You can drop & drop files anywhere you want on the Time Machine other than inside the sparsebundles (Time Machine manages them... so you shouldn't mess with those manually unless you know what you're doing.)

  • Can't use drag&drop

    Hello, I'm using MacBook Pro (retina, 15", late 2013, 2,3 GHz Intel core i7) and after using for a while happened smh strange. I can't use drag&drop, so I can't select the object and drag it. What is wrong?

    Hello!
    I wonder, does the issue persist even after a simple restart of OS X?
    If so, please start Disk Utility (it's in your Applications>Utilities folder), click on your harddrive and select [repair disk permissions]

  • Why can't I Drag & Drop a link from my address bar to my Bookmarks Toolbar in 4.0? I have the toolbar activated, but I can't do this. I was able to do it no problem with 3.6.

    Drag & Drop for bookmarking a link from Address bar to Bookmarks Toolbar is not working in 4.0. Was working in 3.6, then I upgraded to 4.0 and everything got screwed up. How can I fix this?

    I ditched 4.0 and went back to 3.6.17 but I can't drag and drop with it either. The Favicom idea didn't work for me either. Once in a great while it will work, but usually that ends up screwing up my bookmarks and everything being re-arranged. How could something so simple and basic NOT WORK anymore?

  • Why can IPhone not drag/drop BUT Ipod Touch can???!!!

    Hi all,
    Why can I not drag and drop files within Itunes to my Iphone (synch only)
    Whereas on the inferior IPod touch I can !!1 Huh?????
    SvK
    Message was edited by: Steven von Kampen

    BigT_NYCOM wrote:> Actually, from my understanding, iPods can sync contacts and calendars. At least my old Video iPod has all my contacts and calendar in it.
    Yes they can, you are correct. I should have maybe said that in my post. I was merely trying to say that I believe they want to keep the iPhone more organized. I got out of dragging and dropping to my iPod after I created my first playlist. Makes things a lot eaiser just to sync a list.

  • HT1267 i've got about 2500 songs on my iphone, i have replaced my computer & lost my library-question is why can't i drag/drop new downloaded music to my iphone without 'syncing' & losing my 2500 songs from the iphone?

    I've got about 2500 songs on my iphone, i have recently replaced my computer because the old one crashed, so i lost all the songs in the itunes library. My question is, it seems that now i am unable to drag/drop new downloaded songs without syncing my iphone & losing my 2500 songs from the phone?

    You cannot. Iphone will sync/manually manage music with one and only one computer at a time.  Syncing/manually managing with another will erase the current content from the iphone.
    It has always been very basic to always maintain a backup copy of your computer.  Use your backup copy to put everything back.

  • Can't click-drag-drop

    I having sudden and crippling trouble when I try to click and drag files in the finder. When I click-drag a file icon, almost always (>95% of attempts) nothing happens (or the file attempts to open). Rarely the icon moves--but usually some random, uncontrolled, unexpected distance on the screen. Then I "lose" it as if I had released the mouse button. This has resulted in files being dropped indiscriminately in other folders, opening unintended applications, etc.
    A related (?) problem: similar malfunctions arise when I try to click and drag-select text in a document.
    This happens with equal frequency and severity on each of two hard drives, one running 10.3.9 and the other running 10.4.7.
    I hope someone out there recognizes these symptoms and can prescribe action. Thanks.
    upgraded g4 tower (1.4 GHz, 1 Gb memory)

    update: changing the batteries on the wireless Logitech mouse slightly improved the situation--but not by much.
    update 2: when I swap in an old corded one-button Apple mouse, the problem disappears, which places the blame squarely on the wireless mouse. I should have thought of doing this before posting in this forum, sorry.
    Do wireless mice really lose it so abruptly like this? rats, I've gotten accustomed to those programmable buttons and the scroll wheel...

  • Why can't I drag & drop photos to my email anymore?

    The old IPhoto let me just drop and drag a photo onto the bottom part of my e-mail screen (gmail) and it would -boom- just upload as an attachment.  I didn't have to open up the attachments folder finder and waste time.  I updated my MacBook the other day and now with the new Photos, this function is no longer possible.  Why?  Do I have to change a setting or something?
    Thanks

    Simply use the Share feature of Photos
    Use Mail to share photos
    You can use Mail to email photos directly from Photos. When you use Mail to send photos in an email, Photos sends it from the first account listed in your Mail preferences. If you have other email accounts set up in Mail preferences, you can select which email account to send the email from when you send it.
    Tip: If you have many files or large files to send, you can use Mail Drop to send them. You must have an iCloud account to use Mail Drop. You can use Mail Drop to send attachments up to 5 GB in size right from Mail on your Mac, or from icloud.com/mail on your Mac or PC. All file types are supported and attachments don’t count against your iCloud storage.
    Select the photos you want to send.You can send photos from your photo library or an album, but not from a slideshow or a project (such as a book, card, or calendar).
    Click the Share button in the toolbar and choose Mail.Mail opens a mail message with your photos attached.
    Type the recipient’s email address in the To field, then type a subject line in the Subject field.
    Type a message if you want, then click Send.
    LN

  • Can I freely drag & drop clips in iMovie's timeline?

    I'm trying to make a vid of clips playing along with the lyrics of a song. It'd be easier if I could drag the clips wherever I want, but they just get stuck in the position they're dropped in.

    Do you mean that you are trying to get the clips to change in time with the music?  You can drag them around in any order but iMovie will not leave any spaces between them so you have to adjust their durations to get the timing right.
    Geoff.

  • HT201366 Why can I not drag a .mov file from a Download onto my Mac timeline or in a exteral hard drive?

    I received a .mov file along with an option to download the footage. For some reason, I can't open the .mov file???
    Any ideas why I can't?
    Thank you.
    Stu Ross

    Are you getting any error messages?  What do they say?  Exactly what occurs when you try to open the .mov file?
    Which app & version are you trying to use to open the .mov file?  If QT, which one, vX or v7.x which is located inside your Utility folder?
    Per your system profile:
    Mac OS X (10.5.7)
    Please correct.

  • All of a sudden I can no longer drag/drop music onto my iPhone... What happened? :(

    So at some point in the recent past itunes stopped letting me drag music to my iphone.. I don't want to bother syncing my whole library because I have too much music. Why is it making things so difficult all of a sudden? This is REALLY ******* me off.

    roaminggnome is absolutely correct. A easier way of doing this is to click the "Music" tab when the device is connected to iTunes. Within this window, you will be able to select "Sync Music" and then below that select "Selected playlists, artists, albums, and genres." Following this, you will be able to pick and choose which music you want on the device.
    Hope this helps.
    - Greg

  • Use movie clip event handler function, but not via an event

    Let's say I have the following code:
    var initObj = new Object();
    initObj.mood = "happy";
    mc = attachMovie("mcBox","instBox",100,initObj);
    mc.onPress = boxPress;
    function boxPress() {
    trace("Box mood: " + this.mood);
    Now, let's say there are times that I want to call boxPress()
    other than when the onPress event happens. In other words, I want
    to call boxPress() for a movie clip via my AS code, but not when an
    onPress event has occurred for that movie clip. Is this possible?
    Or is it possible to simulate or force an onPress event for a movie
    clip so that the handler function gets called for that movie clip?

    addEventListener only works with components in ActionScript 2
    "workingonasite" <[email protected]> wrote
    in message
    news:f1vu8r$92i$[email protected]..
    > So I am trying to get my head around event Listeners.
    When I use this
    > example
    > on a button it works fine:
    >
    > but when I add the same listener to a movie Clip on the
    stage with an
    > instance
    > name of "box", it does not work. Is there something
    basic I am missing?
    >
    >
    >
    > var buttonListener:Object = new Object();
    > buttonListener.click = function(eventObj:Object) {
    > trace("click");
    > };
    > mybutton.addEventListener("click", buttonListener);
    >

  • MVC Drop Down List Event Handler

    Hello,
    I am trying to create a bsp page using MVC design pattern. I have 3 drop down list fields which are dependent on each other. Example: When you select a value in list 1, drop down list 2 becomes enabled for selection with values based on list 1. At this point of time list 3 should be disabled. Once you select value from 2, list 3 becomes enabled with values based on list 2 selection.
    I have seen a webblog on this topic from Raja but it was designed for bsp page flow design. Could you please guide how do I achieve this in MVC?
    Please help.
    This is what I did:
    I have 1 controller and 1 view.
    In my view:
    =========================================================
    <htmlb:gridLayoutCell columnIndex="2" rowIndex="1">
    <htmlb:dropdownListBox id = "DDLB_PLANT"
             tooltip          = "Plant"
             table            = "<%= v_plants %>"
             onSelect         = "DDLB_PLANTEvent"
             selection        = "<%= v_plantsel %>">
             nameOfKeyColumn  = "WERKS"
             nameOfValueColumn= "DESC_TEXT">
    </htmlb:dropdownListBox>
    </htmlb:gridLayoutCell>
    <htmlb:gridLayoutCell columnIndex="2" rowIndex="2">
    <htmlb:dropdownListBox id = "DDLB_SHIFT"
             tooltip          = "Shift"
             table            = "<%= v_shifts %>"
             onSelect         = "DDLB_SHIFTEvent"
             selection        = "<%= v_shiftsel %>">
             nameOfKeyColumn  = "SHIFT"
             nameOfValueColumn= "SDESC">
    </htmlb:dropdownListBox>
    </htmlb:gridLayoutCell>
    where v_plants and v_shifts are page attributes (table) that is being populated in DO_REQUEST method of controller. v_plantsel and v_shiftsel are type string (page attribute).
    In DO_HANDLE_EVENT (controller)
    DATA: event_id   TYPE REF TO if_htmlb_data,
          ddlb_event TYPE REF TO cl_htmlb_event_selection,
          data       TYPE REF TO cl_htmlb_dropdownlistbox.
    event_id = cl_htmlb_manager=>get_event( request ).
    IF event_id IS NOT INITIAL.
       ddlb_event ?= event_id.
       IF ddlb_event->id EQ 'DDLB_PLANTEvent'.
          c_plantsel = ddlb_event->selection.
       ELSEIF ddlb_event->id EQ 'DDLB_SHIFTEvent'.
          c_shiftsel = ddlb_event->selection.
          CLEAR data.
          data ?= cl_htmlb_manager=>get_data( request      = runtime->server->request
    name         = 'dropdownListBox'
    id           = 'DDLB_PLANTEvent'
    IF data IS NOT INITIAL.
      c_plantsel = data->selection.
    ENDIF.
    ENDIF.
    ENDIF.
    =========================================================
    Thanks,
    Partho

    I though I was able to bind my dropdown return value but this is the error I am getting:
    "Field symbol has not yet been assigned"
    Here is what I am doing:
    Model
    =====
    populate plants
      SELECT werks name1
      FROM   T001W
      INTO   TABLE M_PLANTS
      order by name1.
      where m_plants & m_plantcode has been defined as model attributes.
    Controller
    ==========
    DO_INIT
    *create model instance
    cmodelsetup ?= create_model( model_id   = 'm'
                                 class_name = 'ZPES_SETUP_MODEL' ).
    if cmodelsetup is bound.
       cmodelsetup->getplants( ).
    endif.
    DO_REQUEST
    data: v_setupreview type ref to if_bsp_page.
    dispatch_input( ).
    if is_navigation_requested( ) is not initial.
       return.
    endif.
    create view instance
    v_setupreview = create_view( view_name = 'zsetupreview.htm').
    v_setupreview->set_attribute( name = 'vmodelsetup'      value = cmodelsetup ).
    call_view( v_setupreview ).
    View
    ====
                  <htmlb:gridLayoutCell columnIndex="1" rowIndex="1">
                     <htmlb:label for = "plant" text="Plant" />
                  </htmlb:gridLayoutCell>
                  <htmlb:gridLayoutCell columnIndex="2" rowIndex="1">
                      <htmlb:dropdownListBox id        = "DDLB_PLANT"
                                      tooltip          = "Plant"
                                      table            = "//vmodelsetup/m_plants"
                                      onSelect         = "DDLB_PLANT"
                                      selection        = "//vmodelsetup/m_plantcode"
                                      nameOfKeyColumn  = "WERKS"
                                      nameOfValueColumn= "DESC_TEXT">
                      </htmlb:dropdownListBox>
                  </htmlb:gridLayoutCell>
    PLEASE HELP!!!
    Thanks,
    Partho

  • How can I drag & drop / copy & paste COPY Calendar event on iPad iOS6?

    How can I copy Calendar events on the iPad iOS 6?
    I have read various forums on this subject and have not found an answer on how to perform this basic function.
    To be clear, I am NOT asking how to drag &amp; drop MOVE an event, rather how to duplicate an event.
    In this way, I would not have to create a new event on a different date that is very similar to an existing one.
    If I have missed this in the manual just tell me where it is discussed and I will check it again.
    Thank you!

    Hi,
    I don't think it is possible to do that in iOS 5.
    Best wishes
    John M

Maybe you are looking for