This is a migrated thread and some comments may be shown as answers.

GridView Excel like FilterBox - Translation

4 Answers 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Yves
Top achievements
Rank 1
Yves asked on 02 Nov 2015, 10:55 AM

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

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Nov 2015, 11:51 AM
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
0
Yves
Top achievements
Rank 1
answered on 02 Nov 2015, 12:34 PM

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

 

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Nov 2015, 03:55 PM
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
0
Yves
Top achievements
Rank 1
answered on 03 Nov 2015, 08:44 AM

Thank you very much.

 For now all my open Questions are answered.

Tags
GridView
Asked by
Yves
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Yves
Top achievements
Rank 1
Share this question
or