Page 1 of 1

DataGrid MisAligned

Posted: Thu Feb 02, 2017 7:42 pm
by newpie
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.

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

Re: DataGrid MisAligned

Posted: Sat Feb 04, 2017 11:38 pm
by hpsh
think it is one of 2 problems, either the font are to big, or you need larger row height.

Re: DataGrid MisAligned

Posted: Sun Feb 05, 2017 4:36 pm
by newpie
Thank you for replying. I actually adjusted the row height so that is not the issue. As far as font goes, do DataGrid Tables not allow to adjust the font. I was under the impression this could be done. I will try to upload script so can figure out. Thanks

Re: DataGrid MisAligned

Posted: Mon Feb 06, 2017 3:07 am
by jameshale
What version of LC are you using?
In the shift to the new PI in LC 8 the text (and a few other panes) for the DG were "dropped"
In the current RC release LC8.1.3rc1 they have been reinstated.
LiveCodeScreenSnapz002.jpg
Text panel of DG PI LC8.1.3rc1
Unfortunately these panels are currently missing from the LC9 DP releases.
perhaps DP5 will correct this.

Re: DataGrid MisAligned

Posted: Tue Feb 07, 2017 4:11 am
by newpie
Thanks james, I altered the view with code (example: set the dgProp["header height"] of group "dataGrid 1" to "22") actually, but maybe it is not sticking because of what you mentioned. I am running LC 8.1.2, so I will try other version to get it to stick, if not I will write the staff to see. Thanks

Re: DataGrid MisAligned

Posted: Thu Feb 09, 2017 11:23 am
by hpsh
newpie wrote:Thank you for replying. I actually adjusted the row height so that is not the issue. As far as font goes, do DataGrid Tables not allow to adjust the font. I was under the impression this could be done. I will try to upload script so can figure out. Thanks
i can change the font by selecting the grid, click on the text button at the top, and change the size, pretty sure it is a better way to do that.

has to say that i have to relearn everything about datagrid, everytime i try it.

Re: DataGrid MisAligned

Posted: Thu Feb 09, 2017 3:14 pm
by newpie
Hello, wanted to give you an update. I confirmed with support this was bug introduced in livecode 8, it was put in (Bug 19227) so I am sure it will get fixed. A workaround for now is to reset it by doing the following. Hope this helps.

Code: Select all

on openCard
   set the dgData of group "yourGroup" to empty
end openCard
Thanks

Re: DataGrid MisAligned

Posted: Sun Jul 28, 2019 2:39 pm
by sphere
newpie wrote:
Thu Feb 09, 2017 3:14 pm
Hello, wanted to give you an update. I confirmed with support this was bug introduced in livecode 8, it was put in (Bug 19227) so I am sure it will get fixed. A workaround for now is to reset it by doing the following. Hope this helps.

Code: Select all

on openCard
   set the dgData of group "yourGroup" to empty
end openCard
Thanks
Although this is a very old thread.
It is still an issue.
This line saved me from rebuilding my stack, as once you have something strange, like double text line on a row, you wont get it out. not even by deleting the template and re-adding the DG. (OK in IDE, not OK on Android) but now it is.
I have to be precise: this line above worked only after removing the DG and the template and adding a new DG after saving/reloading the stack. Only replacing the DG for a new one was not enough.

Re: DataGrid MisAligned

Posted: Tue Aug 20, 2019 8:18 pm
by newpie
Thanks Sphere for post. Do you know if the bug is still active in the bug list?

Re: DataGrid MisAligned

Posted: Tue Aug 20, 2019 9:10 pm
by sphere
Hi Newpie,

if i'm correct it could not be reproduced.
SO probably i had a local problem in my stack.
I replaced the DG and templates, it was a lot of work, but ok now.

You can check for errors and open/closed isssues here:https://quality.livecode.com/