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.

Align checkbox description

Thread ID:

Created:

Updated:

Platform:

Replies:

10902 Feb 16,2004 02:30 PM Feb 16,2004 03:09 PM Windows Forms 1
loading
Tags: GridControl
Desis Machino
Asked On February 16, 2004 02:30 PM

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 03:09 PM

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); } }

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.

;