Jump to content

Drag drop between 2 dbgrids


d.bernaert

Recommended Posts

Hello,

for a custom project I need to multi-select a number of records in the left grid.

I must be able to drag them to a second grid and there I have to find out on which record they are dropped in the grid.

This is because I have to insert them before the record they are dropped on (sequence in the database).

Is there any way to get the record I'm dropping the selected records on?

The rest is database stuff, should be able to handle the order on that level.

Thx,

Bernaert Dominique

Link to comment
Share on other sites

i think you mean this:

 

uniDBGrid - properties:

dragdrop.jpg.6168ed8736e2967fc8fd6a8accfe0b86.jpg

 

i use a grid with checkboxes ... multiselect ..

to find the selected records:

s:='-1';
        with UniDBGrid1.DataSource.DataSet do
          for i:=0 to UniDBGrid1.SelectedRows.Count-1 do
          begin
            GotoBookmark(UniDBGrid1.SelectedRows.Items);
            s:=s+','+ UniDBGrid1.DataSource.DataSet.FieldByName('INR').asstring;
          end;

        unimainmodule.markierte_anteile:= 'SELECT * FROM ANTEILE WHERE INR IN ('+s+')';

 

hth

erich

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...