Search code examples
asp.net-core.net-coredevexpressblazordx-data-grid

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


Here is the code

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

    </DxDataGrid>

How to fix this issue and how can i change the font size for this grid.


Solution

  • While DxDataGridColumn doesn't have the DisplayFormatString and EditFormatString properties, you can show data in the required format by formatting it manually. So, the algorithm is the following:

    1. Get data.
    2. Format it.
    3. Assign your formatted data to "dischargeBoards".

    P.S. Currently, DxDataGridDateEditColumn and DxDataGridSpinEditColumn have the DisplayFormatString property: DisplayFormatString, DisplayFormatString

    As for changing the font size of the grid, set its CssClass property (for example, to the "my-grid" value) and apply the following CSS rule:

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