Dario Concilio
Top achievements
Rank 2
Dario Concilio
asked on 11 Oct 2016, 09:08 AM
I read this document CustomText for GridViewNewRow
But I'm using built-in localization mechanism.
How can I do?
4 Answers, 1 is accepted
1
Hi Dario,
As the article explains, you need to create a custom class that inherits the default LocalizationManager class and override the string value for the GridViewNewRow. What is stopping you from using such approach?
Another possibility is to find the TextBlock element within the New Row which contains the Text Value once the RadGridView is loaded:
I have added a sample project for your reference that implements both approaches. Please review it and consider which approach fits scenario the best.
Regards,
Stefan Nenchev
Telerik by Progress
As the article explains, you need to create a custom class that inherits the default LocalizationManager class and override the string value for the GridViewNewRow. What is stopping you from using such approach?
Another possibility is to find the TextBlock element within the New Row which contains the Text Value once the RadGridView is loaded:
private
void
clubsGrid_Loaded(
object
sender, RoutedEventArgs e)
{
var newRowTextBlock =
this
.clubsGrid.ChildrenOfType<TextBlock>().Where(x => x.ParentOfType<Border>().Name ==
"PART_AlwaysVisibleNewRow"
).FirstOrDefault();
if
(newRowTextBlock !=
null
)
{
newRowTextBlock.Text =
"Some Text"
;
}
}
I have added a sample project for your reference that implements both approaches. Please review it and consider which approach fits scenario the best.
Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Nathan
commented on 29 Jun 2021, 07:34 PM
Top achievements
Rank 1
Iron
This is the best solution IMO.
But if you are having the same problem, please vote on this: https://feedback.telerik.com/wpf/1411620-gridview-introduce-property-to-set-the-text-of-the-gridviewnewrow
Thanks
But if you are having the same problem, please vote on this: https://feedback.telerik.com/wpf/1411620-gridview-introduce-property-to-set-the-text-of-the-gridviewnewrow
Thanks
0
Dario Concilio
Top achievements
Rank 2
answered on 13 Oct 2016, 10:39 AM
My problem is that I need to built-in localization for all controls.
If I use LocalizationManager and create CustomResource, Will I lose all the built-in's translations?
0
Accepted
Hi Dario,
The approach suggested in the article would not break the localization that you have applied and will affect only the New Row string. I have added a sample project for your reference which uses an Italian Localization and changes the NewRow text.
If you have any further questions or concerns, do not hesitate to contact us.
Regards,
Stefan Nenchev
Telerik by Progress
The approach suggested in the article would not break the localization that you have applied and will affect only the New Row string. I have added a sample project for your reference which uses an Italian Localization and changes the NewRow text.
If you have any further questions or concerns, do not hesitate to contact us.
Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Dario Concilio
Top achievements
Rank 2
answered on 18 Oct 2016, 10:35 AM
Perfect! It works correctly.
Thank you.