Hi,
the reset also resets the active hilite so that is not an option. I tried with the lighter green background color but at least on a linux machine there is no different (look at the screenshot)
I have to investigate the background color opacity but besides that you have solved my problem, thank you Simon!
BR
Nicke
Change datagrid backgroundcolor for a row from code [SOLVED]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Change datagrid backgroundcolor for a row from code
Ok, I'm back to square one. The code I thought was working is not working as I need.
This will change the background color on row 2 but when I scroll down the "next" line 2 that is outside the area I can see it is also green. So "0002" seems to be tied to the "view area" not the actual line of the datagrid. Using backgroundcolor with opaque also makes the "hilite bar" of the selected line to be under the background color (see post above).
So I would like to have the background of one chosen datagrid line to be colored in the same way as "Alternate Row Colors" works and still be able to use the datagrid as normally.
Is this possible at all?
Code: Select all
on mouseUp
repeat with x = 1 to 4
set the opaque of field ("Col" && x && "0002") of grp "DG1" to true
set the backgroundColor of field ("Col" && x && "0002") of grp "DG1" to "green"
end repeat
end mouseUp
So I would like to have the background of one chosen datagrid line to be colored in the same way as "Alternate Row Colors" works and still be able to use the datagrid as normally.
Is this possible at all?
Re: Change datagrid backgroundcolor for a row from code
Hi Nicke,
I'm not completely sure how you are getting your DG populated but you could try the above.
keram
I had a similar problem with a DG I'm working on and solved it by adding a fixed number to each row in the data before I populated the DG. Then that number I used as a reference in various views I wanted to select from the DG.Nicke wrote:So "0002" seems to be tied to the "view area" not the actual line of the datagrid.
I'm not completely sure how you are getting your DG populated but you could try the above.
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
Re: Change datagrid backgroundcolor for a row from code
Hi keram,
thanks I have to take a look at that approach, but I still have to figure out how to color the wanted line so that the hilite is still visible...
thanks I have to take a look at that approach, but I still have to figure out how to color the wanted line so that the hilite is still visible...
Re: Change datagrid backgroundcolor for a row from code
The solution to my problem is found here http://forums.runrev.com/viewtopic.php?f=8&t=20455