DatagridColumn localization with FormatString

I use the FormatString {0:C} to format a disk column as currency. There are two localizations, german and english. When I switch between the languages, 3.50 ¤
or ¤0.00 is displayed. How do I get the symbols € or $ here?
Best regards
Ralf

Make sure you've set cultures for your app:

Hi,
yes, I know. Here my code:
var supportedCultures = new
{
new System.Globalization.CultureInfo("de-DE")
};
builder.Services.Configure(options =>
{
options.DefaultRequestCulture = new Microsoft.AspNetCore.Localization.RequestCulture("de-DE");
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
});

builder.Services.AddLocalization();

Here is the same enabled in our demos:



My fault. UseRequestLocalization is missing.

I suggest you to pull our demos from GitHub, uncomment the localization code, run locally the app and check what's different from your implementation.

I just found that blazor studio added the line
app.UseRequestLocalization(options => options.AddSupportedCultures("de", "en").AddSupportedUICultures("de", "en").SetDefaultCulture("de"));

But still no success.

And your demo code never shows €, because culture en-US is defined for all datagrid columns like
@String.Format(new System.Globalization.CultureInfo("en-US"), "{0:C}", orders.Sum(o => o.Freight)

Could you please direct me to an example?

Check the screenshots from my reply.

No success. And the code from the RadenBlazorDemos is very different to the code generated by blazor studio.
In program.cs I use:

builder.Services.AddLocalization();
var supportedCultures = new
{
new System.Globalization.CultureInfo("de-DE"),
new System.Globalization.CultureInfo("en-US")
};
builder.Services.Configure(options =>
{
options.DefaultRequestCulture = new Microsoft.AspNetCore.Localization.RequestCulture("de-DE");
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
});
and
app.UseRequestLocalization(options => options.AddSupportedCultures("de", "en").AddSupportedUICultures("de", "en").SetDefaultCulture("de"));

                    <RadzenDataGridColumn TItem="LagdbTest2025.Server.Models.Lagerstellen.TblWerte" Property="Netto" Title="Netto" TextAlign="Radzen.TextAlign.Right" FormatString="{0:C}">
                      <EditTemplate Context="tblWerte">
                       <RadzenFormField Text="Netto" Variant="Variant.Flat">
                        <ChildContent>                          
                          <RadzenNumeric style="display: block; width: 100%" @bind-Value="@tblWerte.Netto" Name="Netto" />
                       </ChildContent>
                      </RadzenFormField>
                      </EditTemplate>
                      <FooterTemplate>
                          @tblRechnungenChild?.TblWertes.Sum(o => o.Netto)
                      </FooterTemplate>
                    </RadzenDataGridColumn>

Still no € or $

What type is your app? Blazor Server or WebAssembly?

WebAssembly. And in the program.cs from the client part blazor studio added:
var culture = await jsRuntime.InvokeAsync("Radzen.getCulture");
if (!string.IsNullOrEmpty(culture))
{
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(culture);
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(culture);
}

Here is what I see in a new Blazor WebAssembly application created using latest version of Radzen Blazor Studio:




You can download the app from here:

It's a browser problem. My customer only uses Chrome, and so do I. Only Chrome is installed on the customer's development environment. There is no problem with Edge and Firefox. Thank you for your help, I did not expect that the problem could be the browser.

Strange. Edge was fine with € and $. I stopped the app, changed a page and restarted the app. € and $ are gone again in Edge. I'll boot and clear cache and cookies of all browsers.

I found the problem. I downloaded your app. All is fine with all browsers; the culture switch shows "English (United States)" and "Deutsch (Deutschland)". I build a test app with sql server connection and add localization. After the start of the app the culture switch is empty, but has two items "English" and "Deutsch". No € or $ after language selection.
I found the difference: my blazor studio 1.43 add the line
app.UseRequestLocalization(options => options.AddSupportedCultures("en", "de").AddSupportedUICultures("en", "de").SetDefaultCulture("de"));
to program.cs.
The line of your test app reads
app.UseRequestLocalization(options => options.AddSupportedCultures("en-US", "de-DE").AddSupportedUICultures("en-US", "de-DE").SetDefaultCulture("de-DE"));
This line is correct and works.
Why did my blazor studio add the incomplete line?

This is the value you have picked while adding the cultures. "de" is for German and de-DE is for German - Germany.

Okay, that's the explanation. But it has an unpleasant side effect and has now cost me half a day. Wouldn't it be better not to offer the entry then?

This has been requested by our users so we can't remove it.

Thanks for your answers.