Calculate number of rows in a DataGrid

Terence Heaford t.heaford at btinternet.com
Wed Nov 19 14:01:07 EST 2014


> On 19 Nov 2014, at 16:51, Trevor DeVore <lists at mangomultimedia.com> wrote:
> 
> *dgVisibleLines*
> - Returns the first and last line being displayed in the data grid as a
> comma delimited list. Useful if you want to provide visual feedback as to
> which lines are being displayed.

Thanks for the suggestion but that is not the information I am after.

Imagine a data grid with 20 rows with each row empty.

I want to return 20.

It seems as per Bob Sneidar’s suggestion I will have to:

Take the height of the grid
subtract the height of the header
obtain the height of a row
then

trunc((the height of the grid - the height of the header)/the height of a row)

This will give the number of full height rows being displayed.

All the best

Terry




More information about the use-livecode mailing list