Dragging to reorder rows in table not working

  • What am I missing?  My table data source implements
    tableView:writeRowsWithIndexes:toPasteboard: and returns YES to
    indicate it wants to allow dragging.  This gets called and I can drag
    an image representing the row around.

    But tableView:validateDrop:proposedRow:proposedDropOperation: is
    never called and neither is tableview:acceptDrop:row:dropOperation:

    Any ideas why?  I just want to allow reordering in the same table.
  • Hi Todd,

    Did you set the Drag data type of your table view by using
    registerForDraggedTypes method ?

    Read the Drag& Drop in Table view Document @ file://localhost/
    Developer/ADC%20Reference%20Library/documentation/Cocoa/Conceptual/
    TableView/index.html

    Regards,
    - Apparao.



    On 10-Sep-07, at 11:22 AM, Todd Blanchard wrote:

    > What am I missing?  My table data source implements
    > tableView:writeRowsWithIndexes:toPasteboard: and returns YES to
    > indicate it wants to allow dragging.  This gets called and I can
    > drag an image representing the row around.
    >
    > But tableView:validateDrop:proposedRow:proposedDropOperation: is
    > never called and neither is tableview:acceptDrop:row:dropOperation:
    >
    > Any ideas why?  I just want to allow reordering in the same table.
    >
  • Doh - that was it.  Thanks!

    On Sep 9, 2007, at 11:13 PM, apparao wrote:

    > Hi Todd,
    >
    > Did you set the Drag data type of your table view by using
    > registerForDraggedTypes method ?
    >
    > Read the Drag& Drop in Table view Document @ file://localhost/
    > Developer/ADC%20Reference%20Library/documentation/Cocoa/Conceptual/
    > TableView/index.html
    >
    > Regards,
    > - Apparao.
    >
    >
    >
    >
    > On 10-Sep-07, at 11:22 AM, Todd Blanchard wrote:
    >
    >> What am I missing?  My table data source implements
    >> tableView:writeRowsWithIndexes:toPasteboard: and returns YES to
    >> indicate it wants to allow dragging.  This gets called and I can
    >> drag an image representing the row around.
    >>
    >> But tableView:validateDrop:proposedRow:proposedDropOperation: is
    >> never called and neither is tableview:acceptDrop:row:dropOperation:
    >>
    >> Any ideas why?  I just want to allow reordering in the same table.
    >>
    >
  • > Message: 16
    > Date: Sun, 9 Sep 2007 22:52:29 -0700
    > From: Todd Blanchard <tblanchard...>
    > Subject: Dragging to reorder rows in table not working
    > To: "Cocoa-Dev (Apple)" <cocoa-dev...>
    > Message-ID: <10A9DA41-1406-4646-A1F3-54693EAAA5A6...>
    > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
    >
    > What am I missing?  My table data source implements
    > tableView:writeRowsWithIndexes:toPasteboard: and returns YES to
    > indicate it wants to allow dragging.  This gets called and I can drag
    > an image representing the row around.
    >
    > But tableView:validateDrop:proposedRow:proposedDropOperation: is
    > never called and neither is tableview:acceptDrop:row:dropOperation:
    >
    > Any ideas why?  I just want to allow reordering in the same table.
    >

    Did you - (void)registerForDraggedTypes:(NSArray *)pboardTypes ??

    Ron
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today