Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize DBGrid column width returns cursor to the left

Status
Not open for further replies.

tomik2476

Programmer
May 19, 2008
7
CZ
Hi,

I have a following problem:
I have a DBGrid (actually a TRxDBGrid) with many columns so that there is a horizontal scroll bar at the bottom of the grid. When I move to the right border of the grid and resize some of the columns' width, the grid automatically shifts back to the left border.
Is there a way to manage the resizing without this moving?

Thank you,
Tomas
 
Have you tried using persistent Columns? (See: Delphi help for details) This is done by double-clicking the DBGrid and gives you each column as an object. It the Object Inspector, you can set several params, including width.

I have an app where clients like to customize the widths. In DBGrid.OnClose, I save the column widths to an ini file, then reload them on startup.

I've never experienced your problem but isn't the default grid action when exiting the last field to jump to the first field of the next record?

BTW: TRxDBGrid has been moved to Project Jedi as TJvDBGrid
(In fact all of RxLib is in the JVCL)

Roo
Delphi Rules!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top