[DataGrid] - Add Loading and LoadingContent parameters #1368
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
Loading(bool, default = false) andLoadingContent(RenderFragment?) parameters to the FluentDataGrid.By default, when
Loadingis set to true, the loading content will be a progress ring with the text 'Loading...' shown besides it. You can replace that with your own content through this parameter.To change the state of the
Loadingparameter at a later stage, use theSetLoadingState(bool loading)method on theFluentDataGrid. To be able to call this method from your code, you need to add a@refto your gridThe loading content is rendered in a
FluentDataGridRowwith oneFluentDataGridCellinside of it. The row height will be set to 100%. If no height is set for the grid this will be a normal row height. It a height is set for the grid, the row will take up all remaining height. In the example below, no height was specified for the grid.In this example te height of the grid is set to 100% of its container. Loading content takes full height (minus header height)

With this PR we are also chaging the way the EmptyContent is rendered to use the same approach (
FluentDataGridRowwith oneFluentDataGridCellinside and following same height settings). As this is a change from earlier versions, please check your results!