Data Grid Line won't Hilite

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

Data Grid Line won't Hilite

Post by hrcap » Thu Apr 22, 2021 7:21 pm

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

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Data Grid Line won't Hilite

Post by stam » Thu Apr 22, 2021 7:33 pm

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

hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

Re: Data Grid Line won't Hilite

Post by hrcap » Thu Apr 22, 2021 7:39 pm

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

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Data Grid Line won't Hilite

Post by stam » Thu Apr 22, 2021 7:46 pm

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...

hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

Re: Data Grid Line won't Hilite

Post by hrcap » Thu Apr 22, 2021 9:33 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Data Grid Line won't Hilite

Post by dunbarx » Thu Apr 22, 2021 11:09 pm

Ah, unintended consequences of a seemingly innocent action.

Call me if you need expert advice on how to fill your life with that.

Craig

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Data Grid Line won't Hilite

Post by Klaus » Fri Apr 23, 2021 11:37 am

A little hint:
There is no need to quote NUMBERS! :D

Code: Select all

...
set the dghilitedline of group "dg_elements" of this card to 1
...

hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

Re: Data Grid Line won't Hilite

Post by hrcap » Fri Apr 23, 2021 11:52 am

Everyday is a school day

Thank you very much Klaus, I didn't know that but I do now.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”