CustomText for GridViewNewRow with built-in localization mechanism

5 posts, 1 answers
  1. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 11 Oct Link to this post

    I read this document CustomText for GridViewNewRow

    But I'm using built-in localization mechanism.

    How can I do?

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 13 Oct Link to this post

    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:

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 13 Oct in reply to Stefan Nenchev Link to this post

    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?

  5. Answer
    Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 17 Oct Link to this post

    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
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 18 Oct in reply to Stefan Nenchev Link to this post

    Perfect! It works correctly.

     

    Thank you.

Back to Top
UI for WPF is Visual Studio 2017 Ready