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

Align checkbox description

Thread ID:





10902 Feb 16,2004 07:30 PM UTC Feb 16,2004 08:09 PM UTC WinForms 1
Tags: GridControl
Desis Machino
Asked On February 16, 2004 07:30 PM UTC

Is it possible to align the checkbox description text so that it aligns to the left of the checkbox as opposed to right of the checkbox?

Administrator [Syncfusion]
Replied On February 16, 2004 08:09 PM UTC

There is no property setting that will do this for you. But you can do this with a combination of property settings and handling an event to draw the text. This code sets the the Description as empty, and then draws the text to be displayed from the Tag in the cell drawn event. gridControl1[rowIndex,colIndex].Tag = "some label"; gridControl1[rowIndex,colIndex].Description = ""; gridControl1[rowIndex,colIndex].CellType = "CheckBox"; gridControl1[rowIndex,colIndex].HorizontalAlignment = GridHorizontalAlignment.Right; private void gridControl1_CellDrawn(object sender, GridDrawCellEventArgs e) { if(gridControl1[e.RowIndex, e.ColIndex].CellType == "CheckBox") { Rectangle rect = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 18, e.Bounds.Height); GridStaticCellRenderer.DrawText(e.Graphics, (string) e.Style.Tag, e.Style.GdipFont, rect, e.Style, e.Style.TextColor); } }


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