5 Answers, 1 is accepted
The localization provider is static and it is shared by all RadGridView instances inside the application. Usually, it is expected to use one common language for the application at a time according to the end-user that is currently running the project. That is why you can't have multiple grids on the form translated in different languages.
If you are not providing full translation to the grid, it would be greatly appreciated if you specify which text exactly you want to translate. Thus, we would be able to think about a suitable solution and provide further assistance. Thank you in advance.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Firstly thank you for the answer.
In fact, my goal was to show different NoDataText for both grids using two different localization providers.
Hello, özer,
This can be easily achieved via the TableElement.Text property:
this.radGridView1.TableElement.Text = "Sample text";
this.radGridView2.TableElement.Text = "Sample text 2";
I believe that it would cover your scenario.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Hello again Dess.
RadGridLocalizationProvider.CurrentProvider =
new
Localization();
rgvReportList.TableElement.Text =
"sample text"
;
rgvLog.TableElement.Text =
"sample text2"
;
Typing your snippet after the localization code did not work. But it worked when I ran the localization code on a condition.
if
(rgvReportList.RowCount > 0)
{
RadGridLocalizationProvider.CurrentProvider =
new
Localization();
}
rgvReportList.TableElement.Text =
"sample text"
;
rgvLog.TableElement.Text =
"sample text2"
;
Thanks again.
Hello, özer,
I am glad that you have found a suitable solution for your scenario.
Indeed, the suggested code doesn't take effect if you change the localization provider after calling the InitializeComponent method:
public RadForm1()
{
InitializeComponent();
RadGridLocalizationProvider.CurrentProvider = new MyEnglishRadGridLocalizationProvider();
this.radGridView1.TableElement.Text = "Sample text";
this.radGridView2.TableElement.Text = "Sample text 2";
}
It is necessary to specify the CurrentProvider property before initializing the components.
This is how it should be applied:
public RadForm1()
{
RadGridLocalizationProvider.CurrentProvider = new MyEnglishRadGridLocalizationProvider();
InitializeComponent();
this.radGridView1.TableElement.Text = "Sample text";
this.radGridView2.TableElement.Text = "Sample text 2";
}
Feel free to use this approach which suits your requirements best.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik