Populating a specific index of a datagrid
Posted: Thu Jul 10, 2014 4:25 am
What I'm trying to do is search column "ID" in MyDataGrid for a match of the string in fld "ID"
When the strings match put a 1 at the index between the row that contains the string in fld "ID" and the column matching fld "Method"
What I have below works but it puts the "1" into the row 3 below the row where the string was found. In the if statement I have an answer theLineNo which validates the correct row number. So what am I doing wrong?
Tom
When the strings match put a 1 at the index between the row that contains the string in fld "ID" and the column matching fld "Method"
What I have below works but it puts the "1" into the row 3 below the row where the string was found. In the if statement I have an answer theLineNo which validates the correct row number. So what am I doing wrong?
Tom
on mouseUp
put fld "Method" into theMethod
put fld "ID" into theID
put the dgNumberOfLines of grp "MyDataGrid" into theCount
repeat with theLineNo = 1 to theCount
put the dgDataOfLine[theLineNo] of grp "MyDataGrid" into theDataA
put theDataA["ID"] into foundID
if theID = foundID then
answer theLineNo
dispatch SetDataOfIndex to grp "MyDataGrid" with theLineNo,theMethod,"1"
end if
end repeat
send RefreshList to grp "MyDataGrid"
put the uSumOfColumn [theMethod] of group "MyDataGrid" into fld "Total"
end mouseUp