Data Grid Column Alignment

zryip theSlug zryip.theslug at gmail.com
Fri Dec 3 06:21:33 EST 2010


On Fri, Dec 3, 2010 at 7:31 AM, RevList <RevList at createchsol.com> wrote:
> I have a data grid with a custom that I set to right align and when I
> assign the dgText to this data grid, the column in question is right
> aligned.
> However, when I create a function that applies a transformation to that
> number and override the default rendering through a column behaviour , the
> alignment switches to left align.
>
> I tried set the dgColumnAlignment["Distance"] of group "dgMileageLog" to
> "right" but nothing changes.
> The properties on that column are set to right align.
>
> All values in the column are 2 decimals so I want them to align to the
> right so that the decimals line up.
>
> Is there something that can be done about this besides using the technique
> in the Rev lessons for aligning decimals in a column.  (Which didn't work
> for me BTW).
> A simple right align is all I need, but it isn't working.
>
> Thanks in advance for any solution.
>
> Stewart


Hi Stewart,

The dgColumnAlignment property is not handled in case you have a
custom behavior.
You have to manage it yourself in the column behavior script.

The layoutControl event could be a good place for this:

on layoutControl
     set the textAlign of field 1 of me to "right"
end layoutControl

Untested but should work.



Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc




More information about the use-livecode mailing list