2

I'm sorting a TDBGrid using it's OnTitleClick event, but I don't want to sort the grid when the user just arranges his columns.

Is it possible to detect if the column was moved / is moving when the OnTitleClick event fires?

OnStartDrag is not fired, because the drag and drop seems to be internal to the grid component.

The only thing I can think of right now is to set a flag when OnColumnMoved is fired and ignore the next execution of the OnTitleClick event.

Is this a good idea or is there a better way?

Jens Mühlenhoff
  • 14,565
  • 6
  • 56
  • 113
  • 3
    related: http://stackoverflow.com/questions/8498746/how-to-discard-mouse-click-in-tdbgrid-oncolumnmoved – Sertac Akyuz Nov 09 '13 at 14:16
  • 1
    Your suggested approach sounds fine. For extra peace of mind you can timestamp the flag you set in OnColumnMoved so you only ignore the event if it's not too long ago. – Johan Nov 10 '13 at 10:43

0 Answers0