Page 1 of 1

To delete a row in a datagrid

Posted: Wed Sep 01, 2010 8:02 am
by gwbasic
I copied and pasted the example from the forum and put it on a button script but it doesn't delete the row. It's just kind of hilite the text on the row. What am I missing here? Please help.

on mouseUp

local tLine, tCutRow

put the dgindex of group "DataGrid 1" into tLine
put "deleteindex " & tLine into tCutRow
send tCutRow to group "DataGrid 1"

end mouseUp

Re: To delete a row in a datagrid

Posted: Wed Sep 01, 2010 3:15 pm
by trevordevore
If you use the debugger (or answer dialog/put statement) I think you will find that tLine doesn't have a number in it. dgIndex is not a property of a data grid, but rather of a row in the data grid. Try putting the dgHilitedIndex of group "DataGrid 1" into tLine and see if that works.

Re: To delete a row in a datagrid

Posted: Thu Sep 02, 2010 4:36 am
by gwbasic
Thanks.

Re: To delete a row in a datagrid

Posted: Thu Sep 02, 2010 2:04 pm
by trevordevore
You're welcome.