Set Datagrid Header alignment?

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm
Location: Utah, USA

Set Datagrid Header alignment?

Post by leston12 » Mon Jun 03, 2013 5:15 pm

Does anyone know how to set the text alignment for the HEADER in a datagrid table?

I see how you can set the alignment for the COLUMN using code:
set the dgColumnAlignment["<columnName>"] to "<value>"
or using the Inspector.

But have been unable to find anything in the datagrid documentation about setting the alignment of the HEADER text.
Always is set to Left.

Thanks!
Leston

icouto
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Wed May 29, 2013 1:54 am
Location: Sydney, Australia

Re: Set Datagrid Header alignment?

Post by icouto » Wed Jun 05, 2013 2:17 am

I suppose one way to do this would be to hide the 'default' headers, and create new headers manually - i.e., either using fields or buttons, depending on the functionality you want. That would have the added benefit of allowing you to really customise the appearance and function of the header row, way beyond merely setting text alignment! :)

I'm curious to hear whether the 'Pros' have hidden tricks or suggestions about this, though!

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

Re: Set Datagrid Header alignment?

Post by Klaus » Wed Jun 05, 2013 11:44 am

I think this feature is really missing in the Datagrid, at least I did not find any hints on this...

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

Re: Set Datagrid Header alignment?

Post by Klaus » Wed Jun 05, 2013 5:02 pm

Hi all,

this IS in fact implemented, but missing from the docs :-/

Here is how:
...
set the dgHeaderAlignment[<yourcolumnname>]of group "yourdatagridname" to "left" ##( or center or right)
....


Best

Klaus

icouto
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Wed May 29, 2013 1:54 am
Location: Sydney, Australia

Re: Set Datagrid Header alignment?

Post by icouto » Wed Jun 05, 2013 11:41 pm

I wonder if there is a way to further customize the header - ie, change fontsize, bgcolor, margins, etc.?

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

Re: Set Datagrid Header alignment?

Post by Klaus » Thu Jun 06, 2013 9:53 am

Hi Igor,

if you are bold enough, you could dive into the x-thousand lines of the datagrid library script :-D
Maybe you will find a hint there, nothing to find in the docs however...


Best

Klaus

Post Reply

Return to “Talking LiveCode”