PivotGrid Localization

15 posts, 1 answers
  1. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 29 Jun Link to this post

    Hi,

    i made a localization class for PivotGrid as from: http://docs.telerik.com/devtools/winforms/pivotgrid/localization/localization

    but some labels are still not translated, for example "Choose fields", "Row Labels" on FieldList, several labels on Print options dialog. Is it possible to make these also translated?

     

    Thanks

    Alex

     

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 29 Jun Link to this post

    Hi Alex,

    Thank you for writing.

    Currently, the field list control cannot be localized using the PivotGridLocalizationProvider class. We have a feature request for such support: ADD. RadPivotFieldList - add Localization provider. The feedback item also suggests a workaround solution. Please make sure to subscribe and vote for the feedback item.

    The currently available localized strings are listed in the mentioned in your post article: Localization.

    I hope this helps. Please let me know if you need further assistance.

    Regards,
    Hristo Merdjanov
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 30 Jun Link to this post

    Hi Hristo,

    Thanks for workaround! Perhaps you have a sample code to translate highlighted labels?

     

    Alex

     

  5. Answer
    Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 30 Jun Link to this post

    Hello Alex,

    Thank you for writing back.

    The present localization provider as described here provides means for localizing the labels in the field list control. Because the field list is a separate control to the pivot the localization provider needs to be loaded in the form`s constructor before calling the InitializeComponent method: 
    public Form1()
    {
     
        PivotGridLocalizationProvider.CurrentProvider = new MyEnglishPivotGridLoclizationProvider();
     
        InitializeComponent();
    }

    I will make sure that the documentation article gets updated accordingly.

    I hope this helps. Should you have further questions do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
  6. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 30 Jun in reply to Hristo Merdjanov Link to this post

    Thanks Hristo, that makes sense

    Alex

     

  7. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 25 Jul Link to this post

    Hi Hristo,

    is it possible to localize month (January etc) when i drop date's field Month on Row/Columns?

    Alex

     

  8. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 25 Jul Link to this post

    Hello Alex,

    This depends on the culture. You can change culture of the provider like this: 
    LocalDataSourceProvider dataProvider = new LocalDataSourceProvider();
    dataProvider.Culture = new System.Globalization.CultureInfo("bg-BG");

    I hope this helps. 

    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  9. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 25 Jul in reply to Dimitar Link to this post

    Thanks Dimitar,

    works fine with LocalDataSourceProvider, but what about QueryableDataProvider? I don't see Culture property there...

    Alex

     

  10. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 26 Jul Link to this post

    Hi Alex,

    Currently, you can only change the culture with the LocalDataSourceProvider. I have added a feature request for this in our Feedback Portal. You can track the item for status changes and add your vote for it here.

    Your Telerik Points have been updated for this request.

    Should you have any other questions do not hesitate to ask.
     
    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  11. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 26 Jul in reply to Dimitar Link to this post

    Thanks Dimitar,

    lookig forward for this update

    Alex

     

  12. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 27 Jul in reply to Alex Dybenko Link to this post

    Hi,

    one more localization question, on tooltip Sum is localized, but "of", "row", "column", "value" are not. Is it a workaround for it?

    Thanks

    Alex

     

  13. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 27 Jul Link to this post

    Hi Alex,

    This is a known issue which is already added to our Feedback Portal. The item is already resolved and the fix will be available in the next official release. The item description contains a workaround for the current version: RadPivotGrid - add localization support for the screentips.

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  14. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 27 Jul in reply to Alex Dybenko Link to this post

    Thanks Dimitar,

    work fine

    Alex

     

  15. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 26 Oct in reply to Hristo Merdjanov Link to this post

    Hi,

    with latest release 1024 workaround from post#2:
    https://feedback.telerik.com/Project/154/Feedback/Details/142052-add-radpivotfieldlist-add-localization-provider

    is not working for ValuesControl: if i change item text for Count or Avg - I can't change values to Count or Avg (other menu items works ok). Is it a workaround for this?

    Thanks

    Alex

     

     

  16. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 27 Oct Link to this post

    Hello Alex,

    I was able to reproduce this and find a workaround that you can use. You need to update the custom PivotFieldListVisualItem class and bypass the menu items click:
    public class MyPivotFieldListVisualItem : PivotFieldListVisualItem
    {
        public MyPivotFieldListVisualItem(FieldListViewModel viewModel)
            : base(viewModel) { }
     
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
     
            CommandBarDropDownButton btn = this.GetType().BaseType
                .GetField("button", BindingFlags.Instance | BindingFlags.NonPublic)
                .GetValue(this) as CommandBarDropDownButton;
     
            if (btn != null)
            {
                btn.DropDownMenu.PopupOpening += DropDownMenu_PopupOpening;
            }
     
     
            RadMenuItem count = this.GetType().BaseType
                .GetField("countMenuItem", BindingFlags.Instance | BindingFlags.NonPublic)
                .GetValue(this) as RadMenuItem;
     
            count.Click += Count_Click;
     
            RadMenuItem sum = this.GetType().BaseType
                .GetField("sumMenuItem", BindingFlags.Instance | BindingFlags.NonPublic)
                .GetValue(this) as RadMenuItem;
     
            sum.Click += Sum_Click;
     
            RadMenuItem avg = this.GetType().BaseType
                .GetField("avgMenuItem", BindingFlags.Instance | BindingFlags.NonPublic)
                .GetValue(this) as RadMenuItem;
     
            avg.Click += Avg_Click;
        }
     
        private void Count_Click(object sender, EventArgs e)
        {
            Value value = (this.Data.DataBoundItem as Value);
             
            bool res = (bool)this.GetType().BaseType.GetMethod("SetNewAggregateFunction", BindingFlags.Instance | BindingFlags.NonPublic)
                .Invoke(this, new object[] { value.Description, "Count" });
            if (value != null && res)
            {
                this.Synchronize();
                FieldListViewModel viewModel = this.GetType().BaseType.GetField("viewModel", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as FieldListViewModel;
                viewModel.ExecuteUpdate();
            }
        }
     
        private void Sum_Click(object sender, EventArgs e)
        {
            Value value = (this.Data.DataBoundItem as Value);
     
            bool res = (bool)this.GetType().BaseType.GetMethod("SetNewAggregateFunction", BindingFlags.Instance | BindingFlags.NonPublic)
                .Invoke(this, new object[] { value.Description, "Sum" });
            if (value != null && res)
            {
                this.Synchronize();
                FieldListViewModel viewModel = this.GetType().BaseType.GetField("viewModel", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as FieldListViewModel;
                viewModel.ExecuteUpdate();
            }
        }
        private void Avg_Click(object sender, EventArgs e)
        {
            Value value = (this.Data.DataBoundItem as Value);
     
            bool res = (bool)this.GetType().BaseType.GetMethod("SetNewAggregateFunction", BindingFlags.Instance | BindingFlags.NonPublic)
                .Invoke(this, new object[] { value.Description, "Average" });
            if (value != null && res)
            {
                this.Synchronize();
                FieldListViewModel viewModel = this.GetType().BaseType.GetField("viewModel", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as FieldListViewModel;
                viewModel.ExecuteUpdate();
            }
        }
        private void DropDownMenu_PopupOpening(object sender, System.ComponentModel.CancelEventArgs args)
        {
            foreach (RadItem item in ((RadDropDownMenu)sender).Items)
            {
                // Validate and localize each of the items
                if (item is RadMenuItem)
                {
                    item.Text = item.Text + "MyText";
                }
            }
        }
    }

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready