DataGrid MisAligned
Posted: Thu Feb 02, 2017 7:42 pm
Hello, I am wondering what might be going on with this DG Table as is compacting all entries (see attached pic). I set it up the DG so I can drag items from another table inside. The strange thing is when I empty it out (set the dgData of group "AnimalsDG" to empty) it works correctly. I did adjust the row template to the same height and still get misaligned entries. Thanks for any help.
This is my 2nd version of coding, the first I changed how it adds to the grid with same misaligned result.
This is my 2nd version of coding, the first I changed how it adds to the grid with same misaligned result.
Code: Select all
on dragenter
## This forces the underlying OS to supply the correct CURSOR
set the dragaction to "copy"
end dragenter
on dragdrop
put the dragdata["text"] into tDraggedAnimal
set itemdelimiter to tab --do this so goes in datagrid
put item 1 of tDraggedAnimal into tVarAdded
##### Checks for Duplicate Drag ######
set itemdelimiter to comma --reset delim for below to work
put the dgData of group "AnimalsDG" into theDataA
put the dgIndexes of group "AnimalsDG" into theIndexes
repeat for each item theIndex in theIndexes
put theDataA[theIndex]["Test"] into tCurrGrid
if tVarAdded is tCurrGrid then
answer warning "Already added " & quote & tVarAdded & quote & " to list!"
exit to top
end if
end repeat
put tUnitAdded into theDataA["Test"]
dispatch "addData" to me with theDataA
dispatch "dragCompleted" to group "AnimalsDG" with true
end dragdrop