Recent

Author Topic: DBGrid columns no resize at run-time  (Read 497 times)

pat03uk

  • New Member
  • *
  • Posts: 20
DBGrid columns no resize at run-time
« on: October 23, 2024, 10:18:17 am »
I can't resize the columns of a DBGrid at run time using the mouse.

I get the resize cursor when hovering over the header junction between columns but no resize.

This is latest Lazarus on a Mac.

Pat

five

  • New Member
  • *
  • Posts: 28
Re: DBGrid columns no resize at run-time
« Reply #1 on: November 12, 2024, 05:10:50 pm »
Hi pat03uk,

I was able to reproduce this behavior. If you have a silent exception on the OnMouseDown event linked to the DBGrid, you will not be able to resize columns.
Check if you have any overloaded events related to the mouse action on your DBGrid that are not raising exception.

Code: Pascal  [Select][+][-]
  1.  
  2. Procedure TfmMainDemo.grdProjectMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  3. Begin
  4.    // Simulate a silent exception
  5.    Abort;
  6. End;  
  7.  
  8.  
« Last Edit: November 12, 2024, 05:20:21 pm by five »

pat03uk

  • New Member
  • *
  • Posts: 20
Re: DBGrid columns no resize at run-time
« Reply #2 on: November 16, 2024, 06:40:43 pm »
five

Thanks for that. I will check but I have since tried KDBGrid, RXDBGrid which work as expected. Then I went back to DBGrid and that now worked fine as well. So I don't know what the problem was.

 

TinyPortal © 2005-2018