My datagrids keep losing their ability to hilight selected lines as soon as I resize the dataGrids using script.
I resize a datagrid by setting the group's width, height, top and left. I can't set the rect of the group because it makes my datagrid disappear off the screen.
All my datagrids' style is Table because I only need to display text.
What would be the correct way to go about resizing a datagrid without breaking it's hilight ability?
Thanks
Gerrie
Last edited by Cairoo on Mon Feb 11, 2013 3:59 pm, edited 1 time in total.
just memorize the hilited lines of your DG and restore it after resizing:
...
lock screen
put the dghilitedlines of grp "your dg here..." into tHL
## do your resizestuff...
set the the dghilitedlines of grp "your dg here..." to tHL
## or maybe use "the dghilitedindexes"
unlock screen
...
I tried your solution and unfortunately the problem persists. However, I've created a separate test project, and for some reason the datagrid in the test project has no hilite problem, even without implementing your solution. I can't figure out what is different in the first project that might be causing the hilite problem.
I'm very reluctant to post my project here since it is proprietary. So I've recorded and uploaded a short video clip to my skydrive of what happens when I resize the datagrid. Perhaps some of you has seen this before and can offer some advice. Here's the link to the short video clip:
But sometimes there ARE in fact gremlins in a stack, I experienced this by myself!
Maybe a field or whatever gets corrupted in very rare cases, and replaceing the object will fix it!
I've removed the part of script that resizes the datagid, and even if I try to ONLY resize the controls not associated with any datagrid, it still breaks the datagrids' hilite.
My script attempts to avoid resizing any controls belonging to a DG by recursively checking the owner of the controls and then resizing a control only if a DG does not show up during the recursive owner check. It may be that my script does not correctly identify the hilite controls as being owned by a datagrid. Perhaps I need to change how I go about indentifying controls that are part of a datagrid? Or should I perhaps not iterate though all the controls on a card? How else would I be able to correctly scale the contents of the card? I would hate having to write a resize script for each individual control!
I've been suspecting my script, but if my script was to blame then how come it works in the test project? I've used the same approach in the test project, only with much less images and graphics. It can't be the images or graphics, right?
So much blood sweat and tears went into creating each object in the stack and all the handlers, that I would HATE having to replace the whole stack. I guess I'll just have to start replacing objects and see if it helps anything...