Posted 20 June 2023, 12:06 am EST
- Updated 20 June 2023, 12:11 am EST
Hi Andy,
I tested the Column Format at my end and it seems to be working fine at my end. The format depends on the culture localization. Please make sure of the following two things:
- You are using the GridDataTimeColumn when defining the column of the FlexGrid.
<GridDateTimeColumn Binding="LastOrderDate" Format="m/dd/yyyy hh:mm:ss tt"
Mode="GridDateTimeColumnMode.Date" MinWidth="160" Width="GridLength.Star"
HorizontalAlignment="C1HorizontalAlignment.Right"
HeaderHorizontalAlignment="C1HorizontalAlignment.Right" />
- You are adding the culture supporting the format (applied in the Program.cs file).
// Allowed using of date, number formats for all available cultures.
var allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures).Select(c => c.Name).ToArray();
var localizationOptions = new RequestLocalizationOptions()
.AddSupportedCultures(allCultures)
.AddSupportedUICultures(allCultures)
.SetDefaultCulture("en");
app.UseRequestLocalization(localizationOptions);
References:
GridDateTimeColumn Class: https://www.grapecity.com/componentone/docs/blazor/online-blazor/C1.Blazor.Grid~C1.Blazor.Grid.GridDateTimeColumn.html
Column Definition Demo: https://www.grapecity.com/componentone/demos/blazor/blazorexplorer/FlexGrid/ColumnDefinitions
Regards,
Ankit
Sample: Date_Format.zip