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

Deleting rows in dat grid forms

2014-01-08 Thread Gerry Orkin
Hi all I have a delete button in the row template group of a data grid form. When the user touches there delete button I do this: deleteRecord the dgIndex of me ...and I handle that command in the card script with: on deleteRecord whichRow dispatch deleteline to group datagrid with

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 On

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 zryip.thes...@gmail.com wrote: Try: on deleteRecord whichRow dispatch deleteIndex to group datagrid with whichRow end deleteRecord ___ use-livecode mailing list

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

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 p...@lcsql.com wrote: Hope that helps, ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to