DataGrid add new row issue with LoadData method #320

Open
opened 2026-01-29 17:35:21 +00:00 by claunia · 7 comments
Owner

Originally created by @s-dezign on GitHub (Feb 8, 2022).

In DataGrid, which is using LoadData method, when you filter out all data and nothing found row showing up. In this case if you will try to add new row, it will never show up. This is only happens in nothing found case.

To Reproduce
Steps to reproduce the behavior:

  1. Open page with DataGrid (which is using Inline Editing and LoadData important method)
  2. Apply a filter on one of the columns so nothing will be found
  3. Try to add new record (row)
  4. See that new row didn't appear

Expected behavior
New row should show up instead of nothing found

Once Again
This is not happens when only Data is using. ONLY when LoadData is using.

Example which causing that bug

<RadzenDataGrid
    @ref="@Grid"
    Style="height: calc(100vh - 149px)"
    AllowFiltering="true"
    FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
    AllowColumnResize="true"
    FilterMode="FilterMode.Advanced"
    AllowPaging="true"
    PageSizeOptions="@PageSizeOptions"
    PageSize="@DefaultPageSize"
    AllowSorting="true"
    IsLoading="@IsLoading"
    LoadData="@LoadData"
    Data="@Data"
    Count="@Count"
    RowCreate="@AddRow"
    RowUpdate="@UpdateRow"
    TItem="DataModel"
    EditMode="DataGridEditMode.Multiple"
    LogicalFilterOperator="LogicalFilterOperator.And">
Originally created by @s-dezign on GitHub (Feb 8, 2022). In DataGrid, which is using `LoadData` method, when you filter out all data and nothing found row showing up. In this case if you will try to add new row, it will never show up. This is only happens in nothing found case. **To Reproduce** Steps to reproduce the behavior: 1. Open page with DataGrid (which is using Inline Editing and LoadData **important** method) 2. Apply a filter on one of the columns so nothing will be found 3. Try to add new record (row) 4. See that new row didn't appear **Expected behavior** New row should show up instead of nothing found **Once Again** This is not happens when only `Data` is using. ONLY when `LoadData` is using. **Example which causing that bug** ``` <RadzenDataGrid @ref="@Grid" Style="height: calc(100vh - 149px)" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowColumnResize="true" FilterMode="FilterMode.Advanced" AllowPaging="true" PageSizeOptions="@PageSizeOptions" PageSize="@DefaultPageSize" AllowSorting="true" IsLoading="@IsLoading" LoadData="@LoadData" Data="@Data" Count="@Count" RowCreate="@AddRow" RowUpdate="@UpdateRow" TItem="DataModel" EditMode="DataGridEditMode.Multiple" LogicalFilterOperator="LogicalFilterOperator.And"> ```
Author
Owner

@enchev commented on GitHub (Feb 9, 2022):

Hey @s-dezign,
There is indeed problem with InsertRow() method when the DataGrid is bound using LoadData. The only workaround we can offer is to insert new item in the collection assigned to Data property instead. You can check also the code generated by Radzen inline edit page template for reference.

@enchev commented on GitHub (Feb 9, 2022): Hey @s-dezign, There is indeed problem with InsertRow() method when the DataGrid is bound using LoadData. The only workaround we can offer is to insert new item in the collection assigned to Data property instead. You can check also the code generated by Radzen inline edit page template for reference.
Author
Owner

@s-dezign commented on GitHub (Feb 9, 2022):

@enchev do you have that code generated by Radzen by any chance ?

@s-dezign commented on GitHub (Feb 9, 2022): @enchev do you have that code generated by Radzen by any chance ?
Author
Owner

@s-dezign commented on GitHub (Feb 9, 2022):

@enchev it is still doesn't work. I did add new item into Data instead of InsertRow(), but first it is causing issue when you cancel Editing new row and second it doesn't resolve issue when No records to display message new row is not appear.

@s-dezign commented on GitHub (Feb 9, 2022): @enchev it is still doesn't work. I did add new item into Data instead of `InsertRow()`, but first it is causing issue when you cancel Editing new row and second it doesn't resolve issue when `No records to display` message new row is not appear.
Author
Owner

@raysefo commented on GitHub (Aug 1, 2022):

I am dealing with the same issue.

@raysefo commented on GitHub (Aug 1, 2022): I am dealing with the same issue.
Author
Owner

@clinically-au commented on GitHub (Apr 19, 2023):

This appears to be an ongoing issue, and it affects the scaffolded code from the current version of Blazor Studio. Is there any documented way to resolve this?

@clinically-au commented on GitHub (Apr 19, 2023): This appears to be an ongoing issue, and it affects the scaffolded code from the current version of Blazor Studio. Is there any documented way to resolve this?
Author
Owner

@OndrejUzovic commented on GitHub (Jul 21, 2023):

Any plans to resolve this issue?

@OndrejUzovic commented on GitHub (Jul 21, 2023): Any plans to resolve this issue?
Author
Owner

@XorZy commented on GitHub (Sep 21, 2023):

I have encountered this issue as well.
I am using the following workaround: before calling InsertRow() I set ShowEmptyMessage to false and it seems to bypass the problem.

@XorZy commented on GitHub (Sep 21, 2023): I have encountered this issue as well. I am using the following workaround: before calling InsertRow() I set ShowEmptyMessage to false and it seems to bypass the problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#320