Datagrid : showing a row by auto scrolling

FlexibleLearning.com admin at FlexibleLearning.com
Thu Nov 13 03:00:25 EST 2014


I would do this manually by setting the vScroll based on (LineNumber *
effective textHeight) - (6 *effective LineHeight)...

on setScroll pLineNumber
    put the effective textHeight of fld 1 into tLineHeight
    set the hilitedLines of fld "Family" to pLineNumber
    set the scroll of fld 1 to (pLineNumber * tLineHeight) - (6 *
tLineHeight)
end setScroll

Hugh Senior
FLCo



Glen Bojsza wrote:

I guess the title is hard to describe what I am trying to do.

Assume a user makes a selection by selecting a choice in a drop down list.

Based on the selection the associated line in the datagrid is located.

But the datagrid has 100+ lines and only shows 12 lines at a time unless
scrolled and the associated line (in this example it is line number 37).

I would like the datagrid to show line number 37 in the visible rows at row
6... in other words it looks like the datagrid was scrolled down to line 37
(keeping the order of the rows the same).

The datagrid doesn't have to visibly scroll just show the selected row (37)
at the position of the 6th row in the visible table with the rows on either
side of it.

I understand if you have questions about this question :-)

regards,

Glen





More information about the use-livecode mailing list