Need More Info
Last Updated: 29 Apr 2024 15:29 by Scott
Scott
Created on: 22 Apr 2024 18:50
Category: Grid
Type: Bug Report
1
Loading and No Data Template Timing

On grids with a lot of data there is a delay between when the grid is assigned the data to when the grid shows the data.  During this UI painting period, the NoDataTemplate is displayed for a second or two.

The grid should not show the NoDataTemplate unless the data source is loaded with an empty collection, not just while it is still trying to show the data.

Note: Having a generic message like in the documentation "No Data available / The data is still loading ..." is not satisfying our users. (Blazor Grid - No Data Template - Telerik UI for Blazor) These should really be two different states that can show different messages.

Thanks

3 comments
Scott
Posted on: 29 Apr 2024 15:29
Yes, I think that would work.  In an ideal scenario, what I would like to see is the grid determine this state by showing the LoadingDataTemplate when the bound data is null and the NoDataTemplate when it is empty.  If a grid does not have a LoadingDataTemplate is would work exactly like it does today, so as not to break existing implementations.  This would save repeating the no records logic in every grid loading scenario.

Thanks for the solution.  Can we leave this open as a feature request instead of a bug report?

    <NoDataTemplate>
            <strong>No Data available</strong>

    </NoDataTemplate>

    <LoadingDataTemplate>
            <strong>The data is still loading...</strong>
    </LoadingDataTemplate>


ADMIN
Nadezhda Tacheva
Posted on: 29 Apr 2024 09:37

Hi Scott and Thomas,

Thank you for your suggestion! I do agree that these are different scenarios - when the Grid has an empty collection and when it is currently waiting to receive the items to display. However, both of these fall under the "no data" category and let me provide some clarification.

By specification, the NoDataTemplate is rendered when the Grid has no data to show. The data requests are made outside of the Grid and thus the Grid has no control over when the items will arrive or even if any items will arrive. In other words, one can make a request to their datasource to fetch the needed data and this may indeed take a while. The key point is that at this stage, the only information that the Grid has is that there are currently no items to show. It is up to the application to manage what will be displayed in the NoDataTemplate based on whether a request is made and the data is awaited or if there are no records to display at all.

Having the above in mind, you can conditionally control the NoDataTemplate content rendering. Here is a basic example: https://blazorrepl.telerik.com/weEeQDut33qz02hu56.

Can you think of any scenario that cannot be covered with this approach? If so, please share a runnable example and I will revise it with the dev team.

Regards,
Nadezhda Tacheva
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Thomas
Posted on: 29 Apr 2024 07:42
I agree, a simple and easy to implement improvement to the grid.