DevExpress XtraGrid Cell Information Horizontal Alignment Adjustment

In DevExpress's XtraGrid control, the following steps are followed to set the horizontal alignment of the information inside the cells.

  • 1 - "Run Designer" opens.
  • 2 - Select "Columns" from the left panel.
  • 3 - The desired column or columns are selected.
  • 4 - Select "AppearanceCell".
  • 5 - Select "TextOptions".
  • 6 - Set the desired value from the "HAlignment" property.

If Near is selected, it will be close to the left, if Center is selected, it will be in the middle, if Far is selected, it will be close to the right.

An example of setting it as code is given below..

this.ID.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; this.NAME.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; this.AMOUNT.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;


You May Interest

Freezing a DevExpress XtraGrid Column

DevExpress XtraGrid Row Header Invisible

DevExpress XtraGrid Clicking Cells to Edit

Getting Value of DevExpress XtraGrid Column

Displaying The DevExpress XtraGrid Footer