Consider this: The visible lines of a data grid correspond to the data grid rows. Scroll, and the top line becomes data grid line 1, even though it is not the first line in the data grid. Sort the data grid by another column, and still, the first visible row is data grid line 1.
Indexes however get assigned to each row and are specific to that row no matter if the user scrolls or sorts. That means any change of order of the rows will scramble the indexes. You have to think about the present objective to know which to use. I had a column of checkboxes next to my data grid which I enabled and disabled based upon the corresponding LINE of the data grid. In this case I used the dataOfLine to get the value of the checkboxes. But in another place I save the dataOfIndex in a variable because the user will be interacting with the form and if he resorts, and I go to save updated information about that row, I need to refer to the absolute index number of the row, NOT the line number. Bob On Jan 8, 2014, at 18:21 , Gerry Orkin <gerry.or...@gmail.com> wrote: > Yep, thanks - it does. I'm now using the line number, not the index :) > > Gerry > > > On 9 Jan 2014, at 1:01 pm, Peter Haworth <p...@lcsql.com> wrote: > >> Hope that helps, > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode