It seems to me that this line of code should change the way text is aligned in a grid:
me.grid.ColStyles(1).TextAlign = GridTextAlign.Right
but this doesn't appear to do anything. What does it do, and how can I change a column's text alignment if this doesn't work?
ADAdministrator Syncfusion Team September 25, 2003 01:53 PM
Don't confuse this with HorizontalAlignment.
TextAlign specifies if text should be displayed left or right of any cell button elements.
See HorizontalAlignment how to align text left, centered and right inside a cell rectangle.
JEJeffMay 23, 2004 09:16 AM
Um.. HorizontalAlignment only seems to be aligning text in headers?
>Don''t confuse this with HorizontalAlignment.
>TextAlign specifies if text should be displayed left or right of any cell button elements.
>See HorizontalAlignment how to align text left, centered and right inside a cell rectangle.
ADAdministrator Syncfusion Team May 23, 2004 11:20 AM
Are you using a GridControl or a GridDataBoundGrid?
ADAdministrator Syncfusion Team November 12, 2004 11:22 AM
style.HorizontalAlignment is the property to use. We do not know of a problem like this. Take a look at the grid\sample\getting started\cellstyles sample. It shows this property in use.
For a GridDataBoundGrid, you do have to set it on the whole column using either grid.GridBoundColumns["Col1"].StyleInfo or grid.Binder.InternalColumns[''Col1"].StyleInfo. But it should work. To set it cell by cell in a GridDataBoundGrid, you would use the PrepareViewStyleInfo event.
Make sure you are not trying to set it on a style that has been set to ReadOnly without useing teh grid.IgnoreReadOnly property.
If you can post a little sample project where it does not work, we can try to track down the problem.