Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DBGrid - selecting the first row, first column

1 view
Skip to first unread message

Pat

unread,
May 18, 2006, 3:10:01 AM5/18/06
to
Got a DBGrid on my form and when it gets the focus the second column
from the left gets the focus.

How can I make sure that every time I tab onto the grid (from another
control) the top left cell gets selected?

i.e. myGrid.column[1].row[1].setfocus

just thought, is this the usual way to work with grids?

any help much appreciated

thanks,
Pat

Zarko Gajic

unread,
May 18, 2006, 7:03:26 AM5/18/06
to
Pat,

> How can I make sure that every time I tab onto the grid (from another
> control) the top left cell gets selected?

"How to focus a specific cell in a DBGrid"
http://delphi.about.com/od/adptips2005/qt/dbgridfocuscell.htm

~Zarko Gajic


Mike Shkolnik

unread,
May 18, 2006, 2:57:49 PM5/18/06
to
Pat,

do the next:
myGrid.DataSource.Dataset.First; {to move to first record}
myGrid.SelectedIndex := 0; {to select first column}

--
With best regards, Mike Shkolnik
E-mail: mshk...@scalabium.com
WEB: http://www.scalabium.com

"Pat" <p...@downunder.com> wrote in message
news:437o62d3635g6pm9l...@4ax.com...

Pat

unread,
May 19, 2006, 3:22:21 AM5/19/06
to
Hi Mike (great Import/Export tools ;) )

>do the next:
>myGrid.DataSource.Dataset.First; {to move to first record}
>myGrid.SelectedIndex := 0; {to select first column}

I still cannot get to the first row, first column; it takes me to the
2nd column.

The only way I can get to the 1st column is make the 1st and 2nd
column the identical field and then make the 1st column visible
property = FALSE.

at least the user will think he's at the first column

Pat

unread,
May 19, 2006, 3:38:43 AM5/19/06
to
Hi Zarko,

I cannot get it to compile with the OVERLOAD directive present.

I get compile error:

myForm.pas(2202): Invalid compiler directive: 'OVERLOAD'

Am using Delphi v6, do I have to add something else somewhere?

thanks


0 new messages