Is there a way to tell whether a certain record is being displayed in a
grid? I meant not just the recno(grid.recordsource) because it's always
in sight.

--
iTech Consulting Co., Ltd.
Specialized in providing ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852) 2325 3883 Fax: (852)2325 8288

Re: Visible records by Bernhard

Bernhard
Tue Jan 02 04:13:18 CST 2007

Hi Man-wai Chang,

> Is there a way to tell whether a certain record is being displayed in a
> grid?
If order is set to 0 and no filter is set (not even DELETED) and the active row
is in the visible part, you could do some calculations with .height, .rowheight,
.headerheight, .activerow, .relativerow and others to find it. But if a filter
is set or an order, then I don't see a reasonable way.
The grid does not disclose such secrets.

> I meant not just the recno(grid.recordsource) because it's always
> in sight.
If you scrolled vertically with the mouse, the active row can get out of the
visible part of the grid!

Regards
Bernhard Sander

Re: Visible records by Man-wai

Man-wai
Tue Jan 02 06:09:12 CST 2007

> If order is set to 0 and no filter is set (not even DELETED) and the
> active row is in the visible part, you could do some calculations with
> .height, .rowheight, .headerheight, .activerow, .relativerow and others
> to find it. But if a filter is set or an order, then I don't see a
> reasonable way.
> The grid does not disclose such secrets.

I would expect a method to do this... Basically, a way to access each
visible cell's controlsource by actual rows and columns of the grid.

Foxpro 10? :)

> If you scrolled vertically with the mouse, the active row can get out of
> the visible part of the grid!

Forgot this one.. Thanks. :0


--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10) Linux 2.6.19.1
^ ^ 20:07:01 up 21 days 2:19 0 users load average: 0.00 0.00 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: Visible records by Man-wai

Man-wai
Tue Jan 02 07:26:19 CST 2007

>> If you scrolled vertically with the mouse, the active row can get out of
>> the visible part of the grid!
>
> Forgot this one.. Thanks. :0

On the other hand, why hi-light a row that's out of sight?

--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10) Linux 2.6.19.1
^ ^ 21:25:01 up 21 days 3:37 0 users load average: 0.00 0.00 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: Visible records by Man-wai

Man-wai
Tue Jan 02 08:39:46 CST 2007

Man-wai Chang wrote:
>>> If you scrolled vertically with the mouse, the active row can get out of
>>> the visible part of the grid!
>> Forgot this one.. Thanks. :0
>
> On the other hand, why hi-light a row that's out of sight?
>

I meant from a user perspective, not a programmer.

--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10) Linux 2.6.19.1
^ ^ 22:39:02 up 21 days 4:51 0 users load average: 0.00 0.00 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: Visible records by Bernhard

Bernhard
Tue Jan 02 09:36:25 CST 2007

Hi Man-wai Chang,

>>>>If you scrolled vertically with the mouse, the active row can get out of
>>>>the visible part of the grid!
>>>
>>>Forgot this one.. Thanks. :0
>>
>>On the other hand, why hi-light a row that's out of sight?
>
> I meant from a user perspective, not a programmer.

Maybe it's merely a philosophical question: if a row is out of sight, does it
have a hi-light or not?

Regards
Bernhard Sander

Re: Visible records by Olaf

Olaf
Sat Jan 06 13:30:28 CST 2007

> Maybe it's merely a philosophical question: if a row is out of sight, does it
> have a hi-light or not?
take a dynamic-property and let it call a function.
In that function log the Recno() and you have the
visible recnos, as this always is called, if a record
is painted.

But unfortunately there is no event if a reocrd goes
out of sight.

You might zap the recno list, then call grid.refresh()
and get the actively seen records. I didn't try so.

Bye, Olaf.