5 Replies Latest reply on Oct 23, 2006 4:01 PM by dimival

    Blocking Drag

    htezcan
      We have an application that has a list (datagrid) from which one can drag an item to be processed. After being dragged we want the item to be blocked for further dragging but still be visible. Any ideas? Thank you
        • 1. Re: Blocking Drag
          dimival Level 1
          Where do you drag the item to? another datagrid?
          • 2. Re: Blocking Drag
            htezcan Level 1
            Yes, to another datagrid.
            HT
            • 3. Re: Blocking Drag
              dimival Level 1
              Ok, i think of two possible solutions:

              a) In your first datagrid, set the dragEnabled and dragMoveEnabled properties to true, this will cause that when you drag it it will be removed for the datagrid. On the datagrid which the item is dropped to, set the dragEnabled property to false so items on this datagrid can't be moved. This way when you drag it and drop it, it will be removed from the first datagrid (which can drag) and added to the second datagrid (where items can't be dragged, just dropped).

              b) When you drop it on the target datagrid, you check if the item already exists, if it does you do not let it be copied, that way you will be able to drag and drop it several times but it will only be processed once.

              Hope this helps you out, i recommend the first option
              • 4. Re: Blocking Drag
                htezcan Level 1
                Even though it is not as elegant I do agree with you that the first option is a good quick solution.
                Thank you.
                • 5. Re: Blocking Drag
                  dimival Level 1
                  Yep, not too elegant but also not too dirty :P
                  I am glad i could help out, dont forget to mark the post as the answer for this thread :P