Cell Alignment in Grid

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Cell Alignment in Grid

Post by soa »

I have a List Control with four columns, two of which are numeric. I want these to be right aligned.

I have CellAlignment for ColumnCRSID1 set to CentreRight but they remain left aligned.

Is there some other setting I need?
GregSippel
Posts: 25
Joined: Thu May 19, 2016 11:34 am

Re: Cell Alignment in Grid

Post by GregSippel »

Try DisplayAlignment(Right) for the column and leave cellAlignment as center.
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: Cell Alignment in Grid

Post by soa »

Thanks Greg, That worked. What is the cell alignment for?
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Cell Alignment in Grid

Post by Stewart Marshall »

Be default, all content fills the available space in the cell. This is governed by the CellSizing property which defaults to FitBoth. This makes sense for typical data values as there's really no reason for the control to do anything else.

However, images and buttons in particular look a little odd filling the whole cell, so by setting CellSizing to none, a button is then whatever size you give it and can be moved around the cell using the CellAlignment. There's probably little need for it beyond center, but it's there just in case.
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply