2009/10/17 Trevor DeVore <li...@mangomultimedia.com> > > There are some scrolling handlers that are documented: > > ScrollIndexIntoView/ScrollLineIntoView > > There is also an undocumented ScrollRectIntoView command you can find in > the Data Grid button. You might want to take a look at those. >
Thanks - but "ScrollRectIntoView" would rely on "## See dgRectOfIndex in order to get rect of a control in the data grid." - and this is broken for cases in which the rows are scrolled above the grid (perhaps when they go above the screens top?) -- see the handler below for a temporary fix. getprop dg_ScrollTop [lineNum] > if lineNum < 2 then return 0 > put the dgControl of the target into dataGrid > if exists(dataGrid) is false then return empty > > if the dgprop ["fixed row height"] of dataGrid is true then > -- not tested yet! > put the the dgprop ["fixed row height"] of dataGrid into > fixedRowHeight > put (lineNum - 1) * fixedRowHeight into scrollTop > else > get the dgVisibleLines of dataGrid > put item 1 of it into firstVizLine > put item 2 of it into lastVizLine > > switch > case lineNum < firstVizLine > if the dgprop ["cache controls"] of dataGrid is false then > return empty > put 0 into scrollTop > repeat with someLineNum = 1 to lineNum > put the dgIndexOfLine [someLineNum] of dataGrid into > someIndexNum > put the dgRectOfIndex [someIndexNum] of dataGrid into > rectOfIndex > put item 4 of rectOfIndex - item 2 of rectOfIndex into > recordHeight > add recordHeight to scrollTop > end repeat > break > default > put the dgIndexOfLine [lineNum] of dataGrid into indexNum > put the dgRectOfIndex [indexNum] of dataGrid into rectOfIndex > > put item 2 of rectOfIndex into recordTop > if recordTop is empty then > -- problem here as the "row" (record view) does not exist so > cannot get its height! > return empty > end if > put recordTop - the top of dataGrid into scrollTop > end switch > end if > > subtract 3 from scrollTop -- just a tweek to show a margin > return scrollTop > end dg_ScrollTop > _______________________________________________ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution