How to change look of data grid column header?

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

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Ocean
Posts: 16
Joined: Wed May 03, 2006 4:29 am

How to change look of data grid column header?

Post by Ocean » Sat Aug 25, 2012 8:35 pm

How does one change the look of the column header of a data grid? For example, the colors of the background gradient (the property inspector only allows changing it to a flat color with no gradients), specifying a background image instead, and so on?

Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 159
Joined: Tue Jan 26, 2010 10:15 pm
Contact:

Re: How to change look of data grid column header?

Post by Zryip TheSlug » Sat Aug 25, 2012 9:10 pm

Ocean wrote:How does one change the look of the column header of a data grid? For example, the colors of the background gradient (the property inspector only allows changing it to a flat color with no gradients), specifying a background image instead, and so on?
Hi Ocean,

For changing the header color of a datagrid, it exists two datagrid properties:
- one for the header background: header background color
- one for the header background when the column header is hilited: header background hilite color

Usage:

Code: Select all

set the dgProp["header background color"] of grp "MyDatagrid" to pColor
Where MyDatagrid is the name of the datagrid
pColor is a single a color, two colors for defining a gradient (one color by line) or an array for a more complex gradient.

Have a look to the datagrid properties here:
http://lessons.runrev.com/s/lessons/m/d ... properties

Please, note the existence of the Data Grid Helper plugin, a product we created for editing properties of a datagrid in a few clicks. For this two properties, DGH allows the definition of a gradient color by using a convenient interface.

A free DGH version is available in the LiveCode market place:
http://www.runrev.com/store/product/dat ... per-1-2-0/


Best,
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel

matthellstrom
Posts: 31
Joined: Mon Apr 27, 2015 3:09 pm

Re: How to change look of data grid column header?

Post by matthellstrom » Mon Apr 27, 2015 8:13 pm

I've downloaded DGH and it's awesome! So much help!

One question: is there a way to have 2 lines in the header on some columns?

Post Reply

Return to “Talking LiveCode”