First, a quick bit about me. I'm new to LiveCode, but have been doing software architecture, design, and development professionally for well over 30 years so I have a pretty good understanding of the concepts.

I'm working on a LiveCode project that displays a modal with a DataGrid table.
If the user selects one or more rows in the DataGrid and clicks the OK button, the selected rows are copied to another DataGrid table in the main stack.
I want to open an edit field in the first of the copied rows in main other stack.
This is the code in my OK button:
Code: Select all
on mouseUp
lock screen
put the dgHiLitedLines of group selectComponentGrid into rowNumbers
put the dgData of group selectComponentGrid into rows
put true into firstTime
repeat for each item rowNumber in rowNumbers
put rows[rowNumber] into row
dispatch "AddData" to group bomGrid of card inventoryItem of stack inventory with row
if firstTime is true then
# Set focus to this row's quantity field.
put "quantity" into colName
put the result into lineNo -- the result contains the index of the new row
send "EditCellOfIndex colName lineNo" to group bomGrid on card "inventoryItem" of stack "inventory"
# At this point the result contains "no control exists for index column"
put false into firstTime
end if
#end if
end repeat
unlock screen
close this stack
end mouseUp
If it's useful, I'm running LiveCode 9.0.0-dp4|Build 15003 Community Edition on Mac OS X 10.11.6.
TIA