Page 1 of 1
Data Grid Line won't Hilite
Posted: Thu Apr 22, 2021 7:21 pm
by hrcap
Hi All
I hope that everyone is well.
Bit of an anomaly... I have a Data Grid and I cant get the selected line to hilite... other DGs in the stack are hilting correctly but this one just won't... I have set up a simple button outside of the dg to test this problem, the code of the button is:
Code: Select all
on mouseup
set the dghilitedline of group "dg_elements" of this card to "1"
end mouseup
I think maybe a setting has turned off???? and im not sure which?
Has anyone come across a similar issue?
Many Thanks
Re: Data Grid Line won't Hilite
Posted: Thu Apr 22, 2021 7:33 pm
by stam
hrcap wrote: ↑Thu Apr 22, 2021 7:21 pm
I think maybe a setting has turned off???? and im not sure which?
The obvious one would be
auto-hilite rows in the 2nd properties inspector panel. Try that?
Hope that helps,
Stam
Re: Data Grid Line won't Hilite
Posted: Thu Apr 22, 2021 7:39 pm
by hrcap
Thank you very much for the swift reply.
I tried the auto-hilite option out of interest and the problem persisted.
As a note I don’t use the auto-hilite feature on my other DGs and the above code works on them to hilite the lines
Many Thanks
Re: Data Grid Line won't Hilite
Posted: Thu Apr 22, 2021 7:46 pm
by stam
Well the code seems correct - and as you say, auto-hilite is not needed for script based hiliting only.
Probably something funky with your data grid then... it wasn't copy/pasted from elsewhere or some such? (that can cause issues...)
It may be worth just re-creating the data grid from scratch?
Or perhaps a long-time LC guru will step in...
Re: Data Grid Line won't Hilite
Posted: Thu Apr 22, 2021 9:33 pm
by hrcap
Again thank you for the reply...
My usual approach is to rebuild the DG but I was heading out on a quick bike ride and thought I would post here just incase anyone had any pearls of wisdom while I was out of the office.
Anyway... when I got back I rebuilt the DG and in the process of doing so figured out what was wrong... I had renamed the background of the DGs Row Template from 'Background' to 'bg' for speeds sake in other code.... it turns out that the DG Hilite functionality references the row template background as 'Background' .... hence I had unknowingly broken the code.
In Summary
Don't rename the background of a DataGrids Row Template, leave it called 'Background'
Thanks for your input as usual
Re: Data Grid Line won't Hilite
Posted: Thu Apr 22, 2021 11:09 pm
by dunbarx
Ah, unintended consequences of a seemingly innocent action.
Call me if you need expert advice on how to fill your life with that.
Craig
Re: Data Grid Line won't Hilite
Posted: Fri Apr 23, 2021 11:37 am
by Klaus
A little hint:
There is no need to quote NUMBERS!
Code: Select all
...
set the dghilitedline of group "dg_elements" of this card to 1
...
Re: Data Grid Line won't Hilite
Posted: Fri Apr 23, 2021 11:52 am
by hrcap
Everyday is a school day
Thank you very much Klaus, I didn't know that but I do now.