GridView Excel like FilterBox - Translation

5 posts, 1 answers
  1. Yves
    Yves avatar
    4 posts
    Member since:
    Apr 2015

    Posted 02 Nov 2015 Link to this post

    Hello,

    i'm trying to translate the PopUp for filtering a column in RadGridView.

     

    I am using "FilterPopupRequired(object sender, FilterPopupRequiredEventArgs e) " to manipulate the popup.

    I got all Elements translated except of two:   (attached is a image that shows the two problematic elements)

    - Textbox that shows "Search...":

          I tried:                    

    foreach (var item in ((RadListFilterPopup)e.FilterPopup).Items)
    {
        if (item as FilterMenuTextBoxItem != null)
        {
            var textBox = ((FilterMenuTextBoxItem)item).TextBox;
            //textBox.Text = "...";
            textBox.NullText = "NULL";
            
        }
    }

    If i set .ext i see it is the right control im changing but i want to set the text if the user did not enter any text so i tried NullText but it is not working. Any ideas?

     

    - First Element in TreeView that shows "All":

       i tried to get the elements of the Treeview but i can't get them.

       Here is my code:

    foreach (var item in ((RadListFilterPopup)e.FilterPopup).Items)
               {
     
                   if (item as FilterMenuTreeItem != null)
                   {
                       var items = ((FilterMenuTreeItem)item).Items; // here items count is 0
                   }
               }

     

    Thank you very much.

     

    Best Regards,

    Yves

     

     

     

     

     

  2. Answer
    Dess
    Admin
    Dess avatar
    1601 posts

    Posted 02 Nov 2015 Link to this post

    Hello Yves,

    Thank you for writing.

    It is suitable to use a RadGridLocalizationProvider and specify the desired strings that you need to change:
    public Form1()
    {
        InitializeComponent();
        this.radGridView1.EnableFiltering = true;
        this.radGridView1.ShowHeaderCellButtons = true;
        this.radGridView1.ShowFilteringRow = false;
     
        RadGridLocalizationProvider.CurrentProvider = new MyRadGridLocalizationProvider();
    }
     
    public class MyRadGridLocalizationProvider : RadGridLocalizationProvider
    {
        public override string GetLocalizedString(string id)
        {
            switch (id)
            {
                case RadGridStringId.FilterMenuSelectionAll:
                    return "My All";
                case RadGridStringId.FilterMenuSearchBoxText:
                    return "My Search...";
            }
            return base.GetLocalizedString(id);
        }
    }

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Yves
    Yves avatar
    4 posts
    Member since:
    Apr 2015

    Posted 02 Nov 2015 in reply to Dess Link to this post

    Dess said:
    I hope this information helps. Should you have further questions I would be glad to help.

     

    Hello Dess,

     thank you for pointing me to this.

    This is a very comfortable way for using own translations.

     

    But i have another question:

    Is there any predefinied translation for different languages delivered by telerik, that i could use out of the box? I found that you offer different resource dll's for WPF, but is there somthing similar for WinForms?

    Best Regard,

    Yves

  5. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 02 Nov 2015 Link to this post

    Hello Yves,

    Thank you for writing back.

    In our Code Library >> Providers and Dictionaries section our community can exchange different localization providers for numerous controls from the UI for WinForms suite. Please refer to the following link: http://www.telerik.com/support/code-library/winforms/localization-providers.

    I hope this information helps. If you have any additional questions, please let me know.
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Yves
    Yves avatar
    4 posts
    Member since:
    Apr 2015

    Posted 03 Nov 2015 Link to this post

    Thank you very much.

     For now all my open Questions are answered.

Back to Top
UI for WinForms is Visual Studio 2017 Ready