Jump to content

Getting uniDBGrid DragDrop Destination Row


Tinygoldwing

Recommended Posts

I'm trying to dragdrop between two dbgrids.  I've set Handled to True so I can insert the data into dataset that I need.  This works.  It just always gets inserted at the bottom.

My issue is that I need to drop into the destination grid between two rows.  The dragdrop actually shows which row it should be inserted to.  The columns are ordered by a field in the database called OrderPlc.  This field usually isn't displayed, but this demo I'm showing it.  Meaning if I have several rows displayed that are numbered between 1-11.  When I dragdrop between row 3 & 4, I'm going to insert the new record and modify remaining OrderPlc by 1 to fix the numbers.  But in order to do this I need to know the drop target row either the destination grid row number or destination datasource recno or the OrderPlc value from column two in the grid below.  I've tried everything and it always returns 1 because that number is based off of the current selected row not the drop target.

How do I get one of these values?  In the grid below I need to return 4 so I can update the database.

image.png.25051758628a49baed653214a1d7e801.png

Thank You

Ed

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...