I have another question about data grids.
In the attached stack Inserting the data into the dg works fine. Selecting the checkboxes and putting their hilite values into variable works also fine. But I'm not able to view the selected lines (click on the 'View Selections' button in the attached stack).
I'm using this code for the 'View Selections' button:
(gAllLines and gMySelection variables are created by the code in the Insert Data' button)
Code: Select all
global gAllLines,gMySelection,gMySelectedLineNrs
on mouseUp
put empty into gMySelectedLineNrs
set the itemDelimiter to tab
local DataArray
put "0" into Counter
repeat for each line i in gMySelection
if item 2 of i is true then
put item 1 of i & tab after gMySelectedLineNrs
add 1 to Counter
end if
end repeat
set the dgData of group "DataGrid 1" to empty
put "0" into Counter
repeat for each line i in gAllLines
if item 1 of i is among the items of gMySelectedLineNrs then
put item 1 of i into DataArray[Counter]["Num"]
put item 2 of i into DataArray[Counter]["BtnCheck"]
put item 3 of i into DataArray[Counter]["Cat"]
put item 4 of i into DataArray[Counter]["Label"]
add 1 to Counter
end if
end repeat
lock screen
set the dgData of group "DataGrid 1" to DataArray
send "RefreshList" to grp "DataGrid 1" --update changes
end mouseUp
keram