Value cannot be null (Parameter format)
Environment
Product |
DateInput for Blazor, DatePicker for Blazor, DateTimePicker for Blazor, TimePicker for Blazor, Grid for Blazor, ListView for Blazor, Wizard for Blazor |
Description
The Blazor app triggers a null reference exception about a format
parameter value. The error may seem to occur on a random basis or consistently, depending on the component configuration.
Error Message
The exception error message can read:
Unhandled exception rendering component: Value cannot be null. (Parameter 'format')
or
Error: System.ArgumentNullException: Value cannot be null. (Parameter 'format')
Possible Cause
The error is caused by an outdated localization resource file (.resx
), which is missing some localization keys.
This exception will occur if the type of TItem is different from the type of the elements in the args.Data collection.
Solution
- Configure the application to use localization.
- Include resource files for all required languages.
- Update the resource files and make sure they contain all required localization strings.
There are two places to get Telerik Blazor localization files:
- The Resources folder of our Blazor demos website. Download the UI for Blazor installer, which contains the offline version of the demo site. Check in folder
/demos/TelerikBlazorDemos/Resources/
. - The
blazor-ui-messages
GitHub repository. The resources files there are maintained by our developer community.