change row color in datgrid, when store data?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

change row color in datgrid, when store data?

Post by tusa »

Hello.

Is it possible, and how, to set the color of a row, when I store data in my datagrid?
It is not alle rows, wich should change, only the row I submit data in.

Best regards Tue.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10509
Joined: Wed May 06, 2009 2:28 pm

Re: change row color in datgrid, when store data?

Post by dunbarx »

Hi.

Perhaps check out page 165 in the DG user guide.

Craig Newman
tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

Re: change row color in datgrid, when store data?

Post by tusa »

And where do I find that?
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: change row color in datgrid, when store data?

Post by Klaus »

tusa wrote:And where do I find that?
Bad memory? :D
http://forums.livecode.com/viewtopic.ph ... 21#p145821
tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

Re: change row color in datgrid, when store data?

Post by tusa »

But that's when you highlight a row in the datagrid?
What I want is to fill some data in some text fields, when I push button, the data goes into the datagrid, and when I fill in these data by clicking the button, then i should change the color of that row, not the text.
Doews that make sense?
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10509
Joined: Wed May 06, 2009 2:28 pm

Re: change row color in datgrid, when store data?

Post by dunbarx »

Hi.

I am not sure if there is a native way to colorize a row in a DG. Maybe Trevor knows :wink:

But the fields in such a gadget are all named according to the extent of the DG itself. So the fields in row 2, say, are named:

"col 1 0002"
"col 2 0002"
"col 3 0002"
etc.

So you can always set the backColor of those fields to whatever you wish. Note that a DG has the "opaque" property of those fields set to "false" on creation, so you will want to set them to "true".

You can write a general handler to do this to any row (or column) you want, and that would be a fun little project.

Craig
Post Reply