-
Notifications
You must be signed in to change notification settings - Fork 460
Description
🐛 Bug Report
I use a DataGrid to display a list of records. Some records have null values for some properties. The DataGrid returns an error when displaying the grid where a column that has sortable enabled but not all records have values for that column.
There is another error that the column name is not displayed when all the records do not have a value for that column.
Unhandled exception rendering component: Arg_NullReferenceException
💻 Repro or Code Sample
Create a DataGrid that has three columns, use PropertyColumn element for defining the columns.
Create a record that has three string properties.
Create a record list property and give it some values. Make sure that at least one record you pass to the list has one property not defined.
For the second error make sure that all records of a list do not have a value for the same column.
🤔 Expected Behavior
The page does not break and show error messages. If all values of a column are empty the column does not sort the records based on that column but the column name is visible.
😯 Current Behavior
The DataGrid returns an error message and the page breaks. The column is not visible.
🔦 Context
There are times when records do not have values for specific properties because the properties were added to the entity after the record was already created or the properties are empty until a specific criteria is not met.
🌍 Your Environment
Visual Studio 2022
Net6.0
Microsoft Edge Version 108.0.1462.76 (Official build) (64-bit)
Windows 11
fast-blazor version 2.0.0.0