Skip to content

This repository contains sample which shows localization of Syncfusion WinForms DataGrid (SfDataGrid).

Notifications You must be signed in to change notification settings

SyncfusionExamples/winforms-datagrid-localization

Repository files navigation

How to Apply Localization for WinForms DataGrid?

This repository contains sample which shows localization of Syncfusion WinForms DataGrid (SfDataGrid).

You can localize the DataGrid by adding resource file for each language.

Changing application culture

When you are changing the application culture, then you can localize the application based on application culture by creating .resx file.

C#

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();
    }
}

VB

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 Class

Creating .resx files

You can create .resx files for any languages by following steps,

  1. Right click your project and click New Folder and set name as Resources.

  2. Add Windows Forms Control Localization default resource files of libraries you are using into Resources folder.

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.

Included default resource file in the application

  1. Now, right click on Resources folder and select Add and then New Item. In the Add New Item wizard, select Resources File option and name the file name as Syncfusion.SfDataGrid.WinForms.<culture name>.resx for German culture. For example, you have to give name as Syncfusion.SfDataGrid.WinForms.de-DE.resx for German culture. In the same way, add new resource files for other libraries used in your application.

Adding custom resource file in the application

  1. Now, select Add and add resource file for German culture in Resources folder.

Included custom resource file in the application

  1. Now, you can copy the key names from default resource files and change its corresponding value based on the culture.

Key Values updated based on the culture

About

This repository contains sample which shows localization of Syncfusion WinForms DataGrid (SfDataGrid).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages