Page 1 of 1
dgHilitedLine
Posted: Fri Apr 02, 2010 5:33 pm
by phaworth
I think I'm right in saying that if I set the dgHilitedLine of a datagrid in a script it does NOT cause a selectionChanged message to be generated. Is there a way to change that behavior? The selection did change after all.
Thanks,
Pete
Re: dgHilitedLine
Posted: Fri Apr 02, 2010 9:07 pm
by trevordevore
That is correct and it is the intended behavior. This is how selectionChanged works with list fields as well. The docs for
selectionChanged explain that it is a message sent when the user makes a change.
Re: dgHilitedLine
Posted: Sat Apr 03, 2010 12:57 am
by phaworth
Thanks, just checking if there was a way to change that behavior.
Pete
Re: dgHilitedLine
Posted: Mon Apr 05, 2010 1:01 pm
by trevordevore
You could define your own custom property in the data grid that does what you want. Something like this in the data grid group script might do the trick:
Code: Select all
setProp myDgHilitedLine pLine
put the dgHilitedLine of me into theOrigLineNo
set the dgHilitedLine of me to pLine
dispatch "selectionChanged" to me with pLine, theOrigLineNo
end myDgHilitedLine
Re: dgHilitedLine
Posted: Mon Apr 05, 2010 5:35 pm
by phaworth
Thanks Trevor, I will try that.
Another thing in your example that is very useful to me is that the selectionChanged message has two parameters when it comes from a datagrid! There's no mention of that in the dictionary, although the dictionary doesn't even mention datagrids in it's description of selectionChanged. I see it does mention it in the Datagrid Manual, I wish I had consulted that insetad of the dictionary!
Thanks,
Pete
Re: dgHilitedLine
Posted: Mon Apr 05, 2010 5:55 pm
by trevordevore
Yeah, the dictionary doesn't have any info on the Data Grid. You should consult the manual at
http://lessons.runrev.com for the latest information.