在 DevExpress for WPF 中,如何在代码隐藏中为特定列设置单元格项的水平对齐方式?
foreach(var column in SalesItemsGrid.Columns)
{
if (currencyFields.Contains(column.FieldName))
{
column.ReadOnly = false;
if (column.EditSettings == null) column.EditSettings = new TextEditSettings();
(column.EditSettings as TextEditSettings).MaskType = MaskType.Numeric;
(column.EditSettings as TextEditSettings).Mask = "c2";
(column.EditSettings as TextEditSettings).MaskUseAsDisplayFormat = true;
}
}