Filter popup after localization

6 posts, 0 answers
  1. Darko
    Darko avatar
    4 posts
    Member since:
    Apr 2018

    Posted 13 Mar 2019 Link to this post

    Hi guys,

    quick and simple: after localization to german, from "Cancel" -> "Abbrechen" the cancel button is cut off, due to the longer text.

    See the attached image. How can I fix it? 

    Note: Making popup wider did not help. How do I access the cancel button to adjust it?

     

    thx and best regards,

    Darko

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3907 posts

    Posted 14 Mar 2019 Link to this post

    Hello, Darko,

    Please refer to the following code snippet demonstrating how to access the cancel button and adjust its size:

    public RadForm1()
    {
        RadGridLocalizationProvider.CurrentProvider = new MyEnglishRadGridLocalizationProvider();
     
        InitializeComponent();
     
        this.radGridView1.FilterPopupInitialized += radGridView1_FilterPopupInitialized;
    }
     
    private void radGridView1_FilterPopupInitialized(object sender, Telerik.WinControls.UI.FilterPopupInitializedEventArgs e)
    {
        RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup;
        if (popup != null)
        {
            popup.PopupOpened -= popup_PopupOpened;
            popup.PopupOpened += popup_PopupOpened;
            popup.Size = new System.Drawing.Size(popup.Size.Width + 100, popup.Size.Height);
        }
    }
     
    private void popup_PopupOpened(object sender, EventArgs args)
    {
        RadListFilterPopup popup = sender as RadListFilterPopup;
        if (popup != null)
        {
            popup.ButtonsMenuItem.ButtonCancel.MaxSize = new Size(popup.ButtonsMenuItem.ButtonCancel.Size.Width - 15, popup.ButtonsMenuItem.ButtonCancel.Size.Height);
        }
    }

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Darko
    Darko avatar
    4 posts
    Member since:
    Apr 2018

    Posted 14 Mar 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess,

    thanks for your answer. I implemented your solution, however, it didnt have any effect on the Cancel Button size. I even tried to set Min, Max and Size to a new Size during popup_PopupOpened event, with no success.The width of the popup itself was adjusted. However I was able to do that before in the FilterPopupRequired event. Can you provide me with a small project where u manage to increase the width of the Cancel button for let say 20?

    Thanks,

    Darko

  4. Darko
    Darko avatar
    4 posts
    Member since:
    Apr 2018

    Posted 14 Mar 2019 in reply to Darko Link to this post

    look at this picture: the size is adjusted, but the button is still cut off. How to prevent this?
  5. Darko
    Darko avatar
    4 posts
    Member since:
    Apr 2018

    Posted 14 Mar 2019 in reply to Darko Link to this post

    I experimented with the Margin Property and it seems to fit now. Look at the picture.

    private void CustRadGridView_FilterPopupRequired(object sender, FilterPopupRequiredEventArgs e)
    {
        if (e.FilterPopup is RadListFilterPopup popup)
        {
            popup.ButtonsMenuItem.ButtonOK.Margin = new Padding(15, 0, 5, 0);
        }
    }
  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3907 posts

    Posted 15 Mar 2019 Link to this post

    Hello, Darko,

    Indeed, the size of the cancel button is adjusted. However, since its location remains unchanged it is cut off because it exceeds the popup. That is why manipulating the location of OK button is an appropriate solution. Thus, the Cancel button's location will be adjusted as well.

    Feel free to use this approach in your application.

    Note that you can use our RadControlSpyForm to inspect different elements and play with their properties. Thus, you can easily find the exact property you need to manipulate in the future development of you project. Additional information about the spy tool is available in the following help article: https://docs.telerik.com/devtools/winforms/tools/controlspy/inspecting-properties

    Should you have further questions please let me know.
     
    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top