Align checkbox description

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?

1 Reply

AD Administrator Syncfusion Team 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); } }

Loader.
Up arrow icon