The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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 06:53 PM UTC
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.
Stefan
JEJeffMay 23, 2004 02:16 PM UTC
Honestly,
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.
>
>Stefan
>
>
ADAdministrator Syncfusion Team May 23, 2004 04:20 PM UTC
Are you using a GridControl or a GridDataBoundGrid?
ADAdministrator Syncfusion Team November 12, 2004 04:22 PM UTC
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.