Page 1 of 1
CRDBGrid and SearchBar
Posted: Tue 03 Jul 2012 20:04
by mariusz
Hi... I have question...
Is there any way to set focus on search or filter bar on runtime? I tried to do it my-selves but without success.
regards
Mario
Re: CRDBGrid and SearchBar
Posted: Wed 04 Jul 2012 07:24
by ZEuS
CRDBGrid is a free component with open source code, that's why you can change the code yourself.
In the declaration of the TCRDBGrid class you should move the CRGridTitleEdit: TCRGridTitleEdit; line from the private to public section and reinstall the TCRDBGrid component. Now, you can use the TCRDBGrid.CRGridTitleEdit.ActivateAt method to set focus on the search or on the filter bar at runtime. For more details, take a look at the implementation of the TCRDBGrid.ActivateSearchEdit and TCRDBGrid.ActivateFilterEdit methods.