- 设置标题文字居中,设置步骤Views->Appearance->HeaderPanel->TextOptions->HAlignment
代码设置如下:
gridViewItem.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
- 设置某一列内容居中,设置步骤Columns->AppearanceCell->TextOptions->HAlignment
代码设置如下:
gridViewItem.Columns.ColumnByFieldName("列名").AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
- 设置所有列内容居中,设置步骤Views->Appearance->Row->TextOptions->HAlignment
代码设置如下:
gridViewItem.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;