Page 1 of 1
put the dgHilitedLines of group "DataGrid 7" into theLineS
Posted: Fri Apr 27, 2018 6:18 pm
by DavJans
I'm having a problem with this grabbing the correct amount of lines but but not the correct lines. This only occurs if the data has been sorted by a column. of no sorting is done the correct lines are selected. Is there any way to fix this issue?
Re: put the dgHilitedLines of group "DataGrid 7" into theLineS
Posted: Fri Apr 27, 2018 8:01 pm
by DavJans
I deleted the datagrid and recreated it. I still have the same problem.
Re: put the dgHilitedLines of group "DataGrid 7" into theLineS
Posted: Fri Apr 27, 2018 8:16 pm
by DavJans
I fixed it but I don't understand why it didn't work in the first place.
I replaced this code:
Code: Select all
put the dgData of group "DataGrid 7" into theDataA
put the dgHilitedLines of group "DataGrid 7" into theIndexes
put empty into tData
repeat for each item theIndex in theIndexes
if tData is empty then
put theDataA[theIndex]["id"] & "," & theDataA[theIndex]["attempt"] & "," & theDataA[theIndex]["fit_Pass_Fail"] & "," & theDataA[theIndex]["weld_Pass_Fail"] into tData
put cr & theDataA[theIndex]["id"] & "," & theDataA[theIndex]["attempt"] & "," & theDataA[theIndex]["fit_Pass_Fail"] & "," & theDataA[theIndex]["weld_Pass_Fail"] after tData
end if
end repeat
With this code:
Code: Select all
put the dgHilitedLines of group "DataGrid 7" into theLineS --grabs hilited line
put empty into tData
repeat for each item tLine in theLineS
put the dgDataOfLine[tLine] of group "DataGrid 7" into theDataA
if tData is empty then
put theDataA["id"] & "," & theDataA["attempt"] & "," & theDataA["fit_Pass_Fail"] & "," & theDataA["weld_Pass_Fail"] into tData
else
put cr & theDataA["id"] & "," & theDataA["attempt"] & "," & theDataA["fit_Pass_Fail"] & "," & theDataA["weld_Pass_Fail"] after tData
end if
end repeat