Radzen DataGrid all rows disappear when editing

I'm trying to implement inline editing. When I click on the edit icon all rows disappear. If I click on the column header (which performs a Sort) the rows come back and the expected row is in edit mode. I cannot see what I'm doing wrong compared to the demo.

<RadzenDataGrid AllowFiltering="true"
                AllowColumnResize="true"
                AllowAlternatingRows="false"
                AllowGrouping="false"
                FilterMode="FilterMode.Advanced"
                AllowSorting="true"
                PageSize="5"
                AllowPaging="true"
                PagerHorizontalAlign="HorizontalAlign.Left"
                ShowPagingSummary="true"
                Data="@foundDiscs"
                Count="@foundDiscCount"
                ColumnWidth="300px"
                LogicalFilterOperator="LogicalFilterOperator.Or"
                SelectionMode="DataGridSelectionMode.Single"
                IsLoading=@isLoading
                Page="@ShowLoading"
                EditMode="@editMode"
                TItem="FoundDisc"
                RowUpdate="@OnRowUpdate"
                RowCreate="@OnCreateRow"
                Sort="@Reset" Filter="@Reset"
                @ref="discGrid">
    <HeaderTemplate>
        <RadzenButton ButtonStyle="ButtonStyle.Success" Icon="add_circle" Text="Add Manually" Click="@InsertRow" />
    </HeaderTemplate>
    <Columns>

        <RadzenDataGridColumn Property="@nameof(FoundDisc.Make)" Title="Manufacturer" Width="160px">
            <EditTemplate Context="theDisc">
                <RadzenTextBox @bind-Value="theDisc.Make" Style="width:200px; display: block" Name="Manufacturer" aria-label="Enter Manufacturer Name" />
                <RadzenRequiredValidator Text="Manufacturer is required" Component="Manufacturer" Popup="true" />
            </EditTemplate>
        </RadzenDataGridColumn>

        <RadzenDataGridColumn Context="theDisc" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Frozen="true"
                              FrozenPosition="FrozenColumnPosition.Right">

            <Template Context="theDisc">
                <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium"
                              Click="@((args) => EditRow(theDisc))" @onclick:stopPropagation="true">
                </RadzenButton>
                <RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="rz-my-1 rz-ms-1" @onclick:stopPropagation="true">
                </RadzenButton>
            </Template>
            <EditTemplate Context="theDisc">
                <RadzenButton Icon="check" Click="@((args) => SaveRow(theDisc))" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Size="ButtonSize.Medium" aria-label="Save">
                </RadzenButton>
            </EditTemplate>
        </RadzenDataGridColumn>
    </Columns>
</RadzenDataGrid>

Try to debug your app to check what you have as data and count.

1 Like

Count was the problem! Thank you! What does Count even do? I removed it and it seems to have no effect. The paging mechanism still works.

Count is very important setting when you want to perform server-side paging using LoadData event - this is how you tell total number of items: