【问题标题】:Removing extra spaces from column header从列标题中删除多余的空格
【发布时间】:2018-05-01 23:37:46
【问题描述】:

我在我的 C# WPF 应用程序中使用 DevExpress GridControl。 我的集合中有 ProductType、ProductCategory 等属性名称,用作此网格的 ItemSource。(AutoGeneratingColumn 设置为 true。) 但我看到网格在列标题标题中的单词之间添加了额外的空间......例如产品类型、产品类别等

有什么办法可以去掉字幕中出现的空格?

我确实尝试了以下方法,但没有成功:

e.column.ColumnChooserHeaderCaption= e.column.FieldName;

谢谢。

【问题讨论】:

    标签: c# devexpress gridcontrol


    【解决方案1】:

    DevExpress WPF 网格:

    //If this property is null the bound FieldName will be used with spaces between capitals
    BaseColumn.Header = "Custom Header";
    

    DevExpress WinForms 网格:

    //Same details apply if null as in WPF example
    GridColumn.Caption = "Custom Header";
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      • 2023-01-16
      • 1970-01-01
      • 2011-08-05
      相关资源
      最近更新 更多