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

Filter popup after localization

5 Answers 82 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Darko
Top achievements
Rank 1
Darko asked on 13 Mar 2019, 12:21 PM

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

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 14 Mar 2019, 08:08 AM
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.
0
Darko
Top achievements
Rank 1
answered on 14 Mar 2019, 10:37 AM

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

0
Darko
Top achievements
Rank 1
answered on 14 Mar 2019, 10:45 AM
look at this picture: the size is adjusted, but the button is still cut off. How to prevent this?
0
Darko
Top achievements
Rank 1
answered on 14 Mar 2019, 11:22 AM

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);
    }
}
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Mar 2019, 01:29 PM
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.
Tags
GridView
Asked by
Darko
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Darko
Top achievements
Rank 1
Share this question
or