#1 2013-09-12 14:28:13

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

TSQLTableToGrid horizontal scroll jump when selecting row

If a TSQLTableToGrid.drawgrid has lots of columns and is scrolled right selecting a row causes the horizontal scrollbar to jump back to the left.

I've found a solution on StackOverflow saying that it is caused by goRowSelect being in the DrawGrid options:
http://stackoverflow.com/questions/3355 … 404#336404

Is goRowSelect absolutely necessary for TSQLTableToGrid to work?

Offline

#2 2013-09-12 15:10:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: TSQLTableToGrid horizontal scroll jump when selecting row

No, it is not mandatory.

It was just for better highlighting of the selected row on screen.

AFAIK you can remove the option at runtime, after TSQLTableToGrid initialization.

Offline

#3 2013-09-12 15:43:00

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: TSQLTableToGrid horizontal scroll jump when selecting row

Thanks, removing the option worked smile

Offline

#4 2013-09-13 06:32:10

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: TSQLTableToGrid horizontal scroll jump when selecting row

Could there be a way of disabling TSQLTableToGrid.DrawGridKeyDown? At the moment it changes the sort order if the left or right arrow keys are pressed but if goRowSelect isn't defined it would be better to allow the default handling of changing the selected cell.

Offline

#5 2013-09-13 07:19:58

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: TSQLTableToGrid horizontal scroll jump when selecting row

You can set

MyDrawGrid.OnKeyDown := nil;

to disable this "feature".

Offline

Board footer

Powered by FluxBB