Jump to content
Ian Branch

TDBGrid - dgTitleClick

Recommended Posts

Can anybody tell me when, Delphi version, TDBGrid.Options - dgTitleClick was introduced?

 

Regards & TIA,

Ian

Share this post


Link to post

Google returned this: http://www.drbob42.com/blog/Blog.aspx?RootId=5:3791 


Delphi 2010 introduces theming for the TDBGrid control, using the DrawingStyle property (which can be gdsThemed (default), gdsClassic or gdsGradient) and introducing GradientStartColor and GradientEndColor for the latter.

It's not the only change made to the TDBGrid control, unfortunately. New are also the dgTitleClick and dbTitleHotTrack flags in the Options property. And although there's no documentation for them in the help (yet), it's pretty obvious what they do. Specifically, setting the dgTitleClick flag in the Options property will ensure that the OnTitleClick event handler is called (when assigned) when someone clicks on the title.

Their intended meaning isn't the issue here. And when you place a new TDBGrid component on a form, the options dgTitleClick and dbTitleHotTrack are included in the Options property by default. However... when you take an existing VCL forms application, and open it up with Delphi 2010, then these previously unknown Option flags will not be in the DFM file, so they will not be set, and hence dgTitleClick and dgTitleHotTrack will be false. And as a surprise the OnTitleClick event handler is no longer called. Simply by recompiling an existing Delphi VCL application in Delphi 2010. Ouch!

So, if you or your customers suddenly find that clicking on TDBGrid titles no longer works, check the dgTitleClick flag of the Options property (of all your TDBGrids).

Edited by Lajos Juhász

Share this post


Link to post

Thanks Lajos,

 

I got sent this earlier..

"

Delphi 2010 and greater: needs dgTitleClick true (grid options) for this to

run: frmItems.DBGrid1TitleClick

dgTitleHotTrack : Specifies that list items are highlighted when the mouse passes over them. (highlights the title cell.. maybe other cells in that column too).

dgTitleClick & dgTitleHotTrack default to true on new forms.

"

So I have worked on that basis.

 

Regards,

Ian

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×