DataGrid-How do I set a certain row a certain color
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
DataGrid-How do I set a certain row a certain color
In a DataGrid, I would like to set a certain row a certain color when one of it's cells has the word "Critical" in it. How do I do this?
Jim...
Jim...
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
This lesson from the manual shows how to colorize text in a row based on a value in the table.
How Can I Colorize Individual Lines in a Table?
How Can I Colorize Individual Lines in a Table?
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Thanks Trevor...It works perfectly when I start a main stack from scratch but when I'm using your scripts on a stack I've already built (IE-following Kevin's script on setting the icons of the "country" buttons to flags) I can not get your script to work. His process has me creating column behaviors. Would this make your scripts break because I already have column behaviors?
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
If you create column behaviors then you have to customize the script of each column behavior so that it colored the line. The issue is that creating a custom column template uses it's own behavior. This means that the default column behavior is no longer used.
Try customizing each column script right now (assuming you don't have too many) and see it you can get it working. If you do and want to consolidate code then let me know and I can point out some possibilities.
Try customizing each column script right now (assuming you don't have too many) and see it you can get it working. If you do and want to consolidate code then let me know and I can point out some possibilities.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Glad you got it working.
You can always consolidate scripts by assigning the behavior property of the custom column templates to the same button. This would effectively share the same script among all columns. Of course this would mean adding an if/then or switch statement in your behavior script based on the column that was being targeted.
You can always consolidate scripts by assigning the behavior property of the custom column templates to the same button. This would effectively share the same script among all columns. Of course this would mean adding an if/then or switch statement in your behavior script based on the column that was being targeted.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder