This repository contains sample which shows localization of Syncfusion WinForms DataGrid (SfDataGrid).
You can localize the DataGrid by adding resource file for each language.
When you are changing the application culture, then you can localize the application based on application culture by creating .resx file.
public partial class Form1 : Form
{
public Form1()
{
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE");
InitializeComponent();
}
}Partial Public Class Form1
Inherits Form
Public Sub New()
Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("de-DE")
Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("de-DE")
InitializeComponent()
End Sub
End ClassYou can create .resx files for any languages by following steps,
-
Right click your project and click
New Folderand set name asResources. -
Add Windows Forms Control Localization default resource files of libraries you are using into
Resourcesfolder.
Note:
Consider you are using SfDataGrid control in your application. Then you need to copy and include Syncfusion.SfDataGrid.WinForms.resx (SfDataGrid present in Syncfusion.SfDataGrid.WinForms library) file in your application under Resources folder. So, now you can know the key names and values of default strings used in Syncfusion.SfDataGrid.WinForms.dll library.
- Now, right click on
Resourcesfolder and selectAddand thenNew Item. In theAdd New Item wizard, select Resources File option and name the file name asSyncfusion.SfDataGrid.WinForms.<culture name>.resxfor German culture. For example, you have to give name asSyncfusion.SfDataGrid.WinForms.de-DE.resxforGermanculture. In the same way, add new resource files for other libraries used in your application.
- Now, select Add and add resource file for
Germanculture inResourcesfolder.
- Now, you can copy the key names from default resource files and change its corresponding value based on the culture.



