Re: Deleting rows in dat grid forms

2014-01-21 Thread Bob Sneidar
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 howeve

Re: Deleting rows in dat grid forms

2014-01-08 Thread Gerry Orkin
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 wrote: > Hope that helps, ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscri

Re: Deleting rows in dat grid forms

2014-01-08 Thread Peter Haworth
Hi Gerry, You're passing in the dgIndex of the row, not the line number. The dgIndex is assigned when data is loaded into the datagrid and never changes which I think explains your problem. You can either use deleteIndexes or pass in the dgHilitedLine of the datagrid and continue to to use delete

Re: Deleting rows in dat grid forms

2014-01-08 Thread Gerry Orkin
Zryip Thanks - same problem :( Gerry On 9 Jan 2014, at 10:56 am, zryip theSlug wrote: > Try: > on deleteRecord whichRow >dispatch "deleteIndex" to group "datagrid" with whichRow > end deleteRecord ___ use-livecode mailing list use-livecode@list

Re: Deleting rows in dat grid forms

2014-01-08 Thread zryip theSlug
Hi Gerry, You are passing an index to the deleteline command. In datagrids, indexes and lines are different things: http://lessons.runrev.com/s/lessons/m/datagrid/l/7344-data-grid-api Try: on deleteRecord whichRow dispatch "deleteIndex" to group "datagrid" with whichRow end deleteRecord O