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
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
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
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);
}
}
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.
Dess | Tech Support Engineer, Sr.
Progress Telerik