Category / Section
What is the difference between the alignment in WinForms GridControl?
Difference between the alignment in GridControl
TextAlign is set when the description of embedded controls is to be aligned to the left or right. For example, in a combobox cell, setting the TextAlign to right aligns the text to the right of the combobox button.
HorizontalAlignment is set when the cell value is to be aligned either left or right or the center of the cell. In the same way the VerticalAlignment is set, when the cell value is to be aligned either at the top or bottom or at the middle of the cell.
// set text alignment as right
this.gridControl1.ColStyles[2].TextAlign = GridTextAlign.Right;
// set horizontal alignment
this.gridControl1.ColStyles[3].HorizontalAlignment = GridHorizontalAlignment.Center;
// set Vertical alignment
this.gridControl1.ColStyles[4].VerticalAlignment = GridVerticalAlignment.Bottom;' set text alignment as right
Me.gridControl1.ColStyles(2).TextAlign = GridTextAlign.Right
' set horizontal alignment
Me.gridControl1.ColStyles(3).HorizontalAlignment = GridHorizontalAlignment.Center
' set Vertical alignment
Me.gridControl1.ColStyles(4).VerticalAlignment = GridVerticalAlignment.BottomThe following screenshot illustrates the alignment in GridControl.

Figure 1: Alignment in GridControl