'DevExpress.Blazor.DxDataGridColumn' 没有 属性 匹配名称 'DisplayFormatString'

'DevExpress.Blazor.DxDataGridColumn' does not have a property matching the name 'DisplayFormatString'

这是代码

<DxDataGrid Data="@dischargeBoards"
                ShowFilterRow="true"
                ShowPager="true"
                ShowGroupPanel="true">
        <DxDataGridColumn Field="@nameof(DischargeGetBoardVisits.DischargeDateExp)" Caption="D/C Exp"  DisplayFormatString="D" EditFormatString="d"></DxDataGridColumn>

    </DxDataGrid>

如何解决此问题以及如何更改此网格的字体大小。

虽然 DxDataGridColumn 没有 DisplayFormatString 和 EditFormatString 属性,但您可以通过手动设置格式来以所需格式显示数据。因此,算法如下:

  1. 获取数据。
  2. 格式化。
  3. 将您的格式化数据分配给 "dischargeBoards"。

P.S。目前,DxDataGridDateEditColumn 和 DxDataGridSpinEditColumn 有 DisplayFormatString 属性: DisplayFormatString, DisplayFormatString

关于更改网格的字体大小,设置其 CssClass 属性(例如,设置为 "my-grid" 值)并应用以下 CSS 规则:

    .my-grid, .my-grid .btn   {
        font-size: 12px;
    }