By default, FlexGrid localizes the column filter editor to use language specified by the CurrentUICulture setting. However, you can use the Language property to override the default and specify the language to be used when grid displays the column filter editor.
Use the below code to change the display language of filter in the WinUI FlexGrid.
XAML code
XAML |
Copy Code
|
---|---|
<Grid> <c1:FlexGrid x:Name="flexGrid1" AutoGenerateColumns="False"> <c1:FlexGrid.Columns> <c1:GridColumn Binding="Id" IsReadOnly="true" Width="*"/> <c1:GridColumn Binding="FirstName" Width="*"/> <c1:GridColumn Binding="LastName" Width="*"/> <c1:GridColumn Binding="Address" MinWidth="200" Width="*"/> <c1:GridColumn Binding="City" MinWidth="200" Width="*"/> <c1:GridColumn Binding="CountryId" Header="Country" MinWidth="150" Width="*"/> <c1:GridColumn Binding="Email" MinWidth="200" Width="*"/> <c1:GridColumn Binding="PostalCode" MinWidth="110" Width="*" /> <c1:GridColumn Binding="Active" MinWidth="110" Width="*"/> <c1:GridDateTimeColumn Binding="LastOrderDate" Mode="Date" MinWidth="110" Width="*" HorizontalAlignment="Right" HeaderHorizontalAlignment="Right"/> <c1:GridDateTimeColumn Binding="LastOrderDate" Mode="Time" Header="Last Order Time" MinWidth="110" Width="*" HorizontalAlignment="Right" HeaderHorizontalAlignment="Right"/> <c1:GridColumn Binding="OrderTotal" Format="C" MinWidth="110" Width="*" HorizontalAlignment="Right" HeaderHorizontalAlignment="Right"/> </c1:FlexGrid.Columns> </c1:FlexGrid> </Grid> |
Code view
C# |
Copy Code
|
---|---|
//Setting Culture and Language to Japanese var culture = new CultureInfo("ja-JP"); Thread.CurrentThread.CurrentCulture = culture; Thread.CurrentThread.CurrentUICulture = culture; flexGrid1.Language = "ja-JP"; |