We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to set column text alignment?

Thread ID:

Created:

Updated:

Platform:

Replies:

7466 Sep 25,2003 02:46 PM Nov 12,2004 11:22 AM Windows Forms 4
loading
Tags: GridControl
Don
Asked On September 25, 2003 02:46 PM

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?

Administrator [Syncfusion]
Replied On September 25, 2003 02: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. Stefan

Jeff
Replied On May 23, 2004 10:16 AM

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 > >

Administrator [Syncfusion]
Replied On May 23, 2004 12:20 PM

Are you using a GridControl or a GridDataBoundGrid?

Administrator [Syncfusion]
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;