title | description | type | page_title | slug | position | tags | ticketid | res_type |
---|---|---|---|---|---|---|---|---|
Value cannot be null. (Parameter 'format') |
Fix error Value cannot be null. (Parameter 'format') when using Telerik UI for Blazor. |
troubleshooting |
Value cannot be null. (Parameter 'format') |
common-kb-null-value-parameter-format |
telerik, blazor, null, value, parameter, format, localization |
1528567, 1570325 |
kb |
Product | UI for Blazor |
I am getting an error when I am using a Telerik Blazor component in an application with enabled localization.
The exact error message can vary. Here are just a few examples:
Unhandled exception rendering component: Value cannot be null. (Parameter 'format')
System.ArgumentNullException: Value cannot be null. (Parameter 'format')
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object arg0, Object arg1)
at Telerik.Blazor.Components.TelerikWizard.get_PagerMessage()
System.ArgumentNullException: Value cannot be null. (Parameter 'format')
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at Telerik.Blazor.Components.Common.Filters.FilterMenu.TelerikFilterMenu.get_FilterMenuSettingsLabel()
A similar error can occur if a component is used in a localized application, but the .resx
files are missing some keys for the corresponding component.
The app either needs to implement localization for the Telerik components correctly, or not implement a localization service at all. Partial localization is not possible. So, it is essential that the .resx
files for the Telerik components are always up-to-date and contain all the necessary keys.
To solve the issue, make sure that:
- The [application is correctly configured to use localization]({%slug globalization-localization%})
- The resx files are up-to-date and contain all required localization strings
Find the latest localization files in two places:
- (maintained by Telerik) In the offline version of our Blazor demo site. Download our [UI for Blazor automated installer]({%slug installation/msi%}) or [UI for Blazor ZIP archive]({%slug installation/zip%}). Then, look inside folder
/demos/TelerikBlazorDemos/Resources/
. - (maintained by the community) In the telerik/blazor-ui-messages GitHub repository
In some cases, you might not get an error, but components may appear partially localized (some texts are missing). More details on that are available at [Partially Localized Components, Missing Text, Not Translated Text]({%slug common-kb-partial-localization%}).
- [Telerik Blazor localization]({%slug globalization-localization%})