Page 1 of 1
dataGrid hilite problems [solved]
Posted: Thu Feb 07, 2013 6:59 pm
by Cairoo
Hi all
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
Re: dataGrid hilite problems
Posted: Thu Feb 07, 2013 7:12 pm
by Klaus
Hi Gerrie,
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
...
Best
Klaus
Re: dataGrid hilite problems
Posted: Fri Feb 08, 2013 9:27 pm
by Cairoo
Thanks Klaus.
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:
https://skydrive.live.com/redir?resid=8 ... 5NGBTkx9xc
- Gerrie
Re: dataGrid hilite problems
Posted: Sun Feb 10, 2013 12:12 pm
by Klaus
Hi Gerrie,
well, this is REALLY strange!?
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!
Best
Klaus
Re: dataGrid hilite problems
Posted: Sun Feb 10, 2013 8:51 pm
by Cairoo
Strange indeed.
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...
Re: dataGrid hilite problems
Posted: Mon Feb 11, 2013 3:31 pm
by Cairoo
I found the cause of the problem!
It happened because I set the lockLocation property of the datagrid to false before resizing and then to true after resizing.
Silly me!!!
At least now we know about one more thing we should never do:
Don't mess with a datagrid's lockLocation property when resizing it.
There.
Thanks to all of you who tried to help
- Gerrie
Re: dataGrid hilite problems [solved]
Posted: Mon Feb 11, 2013 4:02 pm
by Klaus
Hi Gerrie,
AHA!
Glad you could solve your problem!
Best
Klaus