[Solved] Managing the number of items displayed in a RadSplitButtonElement

1 Answer 7 Views
Buttons, RadioButton, CheckBox, etc
Laurent
Top achievements
Rank 1
Iron
Iron
Iron
Laurent asked on 20 Jul 2026, 02:00 PM

Hello,
I am using a RadSplitButtonElement:
DEFINE PRIVATE VARIABLE BtnAnnulerSplit                 AS Telerik.WinControls.UI.RadSplitButtonElement NO-UNDO.

and I would like to control the number of items displayed. If there are more than can fit, display a vertical scrollbar; otherwise, do not.
I have written the following code:

DEFINE VARIABLE oMenu       AS Telerik.WinControls.UI.RadDropDownMenu NO-UNDO.
DEFINE VARIABLE iItemHeight AS INTEGER NO-UNDO.
        oMenu = BtnAnnulerSplit:DropDownMenu.
        iItemHeight = 10.

        oMenu:Maximum = NEW System.Drawing.Size(0, 20 * iItemHeight).

I do have a size, but no vertical scrollbar, which means I can’t see all the items.
Thank you for your feedback
Translated with DeepL.com (free version)

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 20 Jul 2026, 03:56 PM

Hello, Laurent,

By default, the drop-down menu is auto-sized, and its height is calculated automatically based on the number of available items and their height. If the items do not fit within the available space, a vertical scrollbar is displayed.

Based on your description, it appears that you would like to set a custom height for the drop-down menu. You can achieve this by using the following code snippet:

 RadDropDownMenuElement popupElement = this.radSplitButton1.DropDownButtonElement.DropDownMenu.PopupElement as RadDropDownMenuElement;
 popupElement.MaxSize = new Size(0, 20 * iItemHeight);
 popupElement.ScrollPanel.MaxSize = new Size(0, 20 * iItemHeight);
 popupElement.MinSize = new Size(0, 20 * iItemHeight);

I hope this information helps. If you have any other questions, do not hesitate to ask.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Modernizing a WinForms application? Use the AI-powered WinForms Converter to simplify migration to Telerik UI for WinForms.
Laurent
Top achievements
Rank 1
Iron
Iron
Iron
commented on 21 Jul 2026, 08:22 AM

Thank you

code OOABL:

METHOD PUBLIC VOID GestionBtnAnnulerSplit(  ):
        
        DEFINE VARIABLE oPopupElement AS Telerik.WinControls.UI.RadDropDownMenuElement NO-UNDO.        
             
        oPopupElement = CAST(BtnAnnulerSplit:DropDownMenu:PopupElement,Telerik.WinControls.UI.RadDropDownMenuElement).
                                            
        oPopupElement:MaxSize = NEW System.Drawing.Size(300, 200).
        oPopupElement:ScrollPanel:MaxSize = NEW System.Drawing.Size(300, 200).
        oPopupElement:MinSize = NEW System.Drawing.Size(300, 200).
        
        RETURN.
    END METHOD.

Nadya | Tech Support Engineer
Telerik team
commented on 21 Jul 2026, 10:48 AM

Hello, Laurent,

I am glad to hear that the suggested solution works for you in OE ABL and that now the RadSplitButton appears as you wish.

Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Laurent
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or