Board index » delphi » DBGrid Column Move

DBGrid Column Move

I've enabled the columns of a DBGrid to be resized and moved.  However, I'm
using the OnTitleClick event to open a dialog.  My problem is that each time
a column is moved to a new position my application opens the dialog.  Is
there anyway to stop the OnTitleClick from happening when a column is moved?

Thanks

 

Re:DBGrid Column Move


An easy (not very ellegant but easy) way to to this is with a private (global)
variable named by example ColWasMoved : Boolean.
Put it in false on the create of the form.
Put in in true in the first line of the OnMoveColumn event of the dbgrid.
And in the OnTitleClick check first if it's true.
    if not ColWasMoved then
        Do your normal code.
And in the last line put ColWasMove in False again.
hope this helps, bye

Quote
Steve Bench wrote:
> I've enabled the columns of a DBGrid to be resized and moved.  However, I'm
> using the OnTitleClick event to open a dialog.  My problem is that each time
> a column is moved to a new position my application opens the dialog.  Is
> there anyway to stop the OnTitleClick from happening when a column is moved?

> Thanks

--
Guillermo Casta?o Acevedo <SIRIO>
Guiller...@GrupoMillennium.com
Guillermo...@Hotmail.com
WWW: http://www.GrupoMillennium.com (Gerente de Sistemas)
ICQ # 33844513
Systems and Computers Engineer

Other Threads