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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Datagrid Column Alignment

Thread ID:





418 Jun 25,2002 10:33 AM UTC Jun 25,2002 11:35 AM UTC WinForms 1
Tags: FAQ
Vipul Bhatt
Asked On June 25, 2002 10:33 AM UTC

How can I have column headers center alignment while its text being left/right aligned

Clay Burch [Syncfusion]
Replied On June 25, 2002 11:35 AM UTC

The center alignment for the headers appears to be broken. In an posting on microsoft.public.dotnet.framework.windowsforms on 5/23/02, Daniel Herling [MS] stated that this was a known bug, and they intended to fix it in a future release. If you need to center the text before the fix is released, you might try adding some leading blanks as part of the headertext. You could even write a method that would add enough blanks so the text is more or less centered. To do this, you would need to get the column width, and call Measure String on the headertext. You could repeatedly add blanks and call MeasureString until the string would be close to center.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon