How Do I Scroll a Row To The Top of the Data Grid Form?
This lesson will show you how to scroll a particular row to the top of the Data Grid form using the dgRectOfIndex (or dgRectOfLine) property. This technique is useful when your rows are not a fixed height.
How To Do It
Here is the code that will scroll the selected line to the top of the data grid.
Copy & Paste
put the dgHilitedIndex of group "DataGrid" into theIndex
put the dgRectOfIndex [theIndex] of group "DataGrid" into theControlRect
put the rect of group "DataGrid" into theGridRect
put item 2 of theGridRect - item 2 of theControlRect into theOffset
set the dgVScroll of group "DataGrid" to the dgVScroll of group "DataGrid" - theOffset