Jump to content


Photo

Drag and Drop Interfering with Column Move and Resize.


  • Please log in to reply
1 reply to this topic

#1 Speed

Speed
  • Members
  • 190 posts
  • Gender:Male

Posted 15 March 2016 - 04:21 AM

Hi Boki,

 

I am using drag and drop with TNextGrid (V5) to move rows to another control.  This works fine but the drag and drop interferes with resizing and moving columns of the grid.  Is there anything I can do to prevent this?

 

I have tried calling EndDrag(False) on the ColumnResize and ColumnMove events but it doesn't work that well.

 

Regards,

 

Steve

 



#2 Speed

Speed
  • Members
  • 190 posts
  • Gender:Male

Posted 16 March 2016 - 04:48 AM

Never mind, I worked it out.  I changed the code in the MouseDown event to this:

 

   if (Sender is TNextGrid) and
      (Button = mbLeft) then
   begin
      if grdEmails.SelectedCount > 0 then
      begin
         with TNextGrid(Sender) do
         begin
            // It can't be the header
            if grdEmails.GetRowAtPos(X, Y) > -1 then
            begin
               BeginDrag(False);
            end;
         end;
      end;
   end;






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users