Subject RE: [IBO] How to position selected record in grid to center????
Author Michael L. Horne
Great, that seems to be working now.

Thanks a bunch!

Michael L. Horne

> -----Original Message-----
> From: Geoff Worboys [mailto:geoff@...]
> Sent: Saturday, May 25, 2002 12:55 AM
> To: Michael L. Horne
> Subject: Re: [IBO] How to position selected record in grid to center????
>
>
> > I tried your code, and thought it worked at first, but then I
> > noticed that it alternated between centering the row and placing it
> > about 2 lines down from the top. Center Top Center Top Center Top
> > ...
>
> Yep I do see that in a sorted grid (my original test had no sorting).
>
> First - do use an "if Locate(..." so that you are only trying to
> adjust things if locate found the record.
>
> Second - my original code seems to have been mistaken in its use of
> GridRow. This seems to work...
>
> if qyAltGrid.Locate('ALT_PART', Part,
> [lopPartialKey, lopFindNearest]) then
> gridAlt.TopRowNum := qyAltGrid.RowNum -
> (gridAlt.VisibleGridRows div 2 );
>
> You may need to adjust slightly according to whether the title (fixed)
> row is showing - which is what I thought was happening by using
> GridRow. I am not entirely clear why the first code was not
> consistent but if at first you dont succeed...
>
>
> > Any ideals???
>
> Lots of very high ideals :-)
>
> --
> Geoff Worboys
> Telesis Computing
>
>
>
> __________________________________________________________________
> _________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
> __________________________________________________________________
> _________
> http://www.ibobjects.com - your IBO community resource for Tech
> Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>