Is it possible to insert DropDown button into another one?

1 Answer 37 Views
Buttons
Pavel Krebs
Top achievements
Rank 1
Pavel Krebs asked on 25 Jul 2024, 08:31 AM

Hello,

I tried to insert a DropDown button into another one and the inner button is not possible to expand:

            <telerikControls:RadDropDownButton Content="Drop down 1"  
                                   DropDownWidth="180">
                <telerikControls:RadDropDownButton.DropDownContent>
                    <StackPanel Orientation="Vertical">
                        <telerikControls:RadDropDownButton Content="Drop down 2"  
                                   DropDownWidth="180">
                            <telerikControls:RadDropDownButton.DropDownContent>
                                <ListBox>
                                    <ListBoxItem Content="Item 4" />
                                    <ListBoxItem Content="Item 5" />
                                    <ListBoxItem Content="Item 6" />
                                </ListBox>
                            </telerikControls:RadDropDownButton.DropDownContent>
                        </telerikControls:RadDropDownButton>
                        <ListBox>
                            <ListBoxItem Content="Item 1" />
                            <ListBoxItem Content="Item 2" />
                            <ListBoxItem Content="Item 3" />
                        </ListBox>
                    </StackPanel>
                </telerikControls:RadDropDownButton.DropDownContent>
            </telerikControls:RadDropDownButton>

Is it possible to make it work?

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 29 Jul 2024, 04:35 PM

Hello Pavel,

This scenario may not be ideal as the RadDropDownButton's drop-down content is placed inside a Popup and opening a Popup inside a Popup is not a suggested setup.

Instead of using nested RadDropDownButton elements, may I suggest using a RadExpander for the drop-down part:

 <telerikControls:RadDropDownButton Content="Drop down 1"  
                                DropDownWidth="180">
     <telerikControls:RadDropDownButton.DropDownContent>
         <StackPanel Orientation="Vertical">
             <primitives:RadExpander>
                 <ListBox>
                     <ListBoxItem Content="Item 4" />
                     <ListBoxItem Content="Item 5" />
                     <ListBoxItem Content="Item 6" />
                 </ListBox>
             </primitives:RadExpander>
             <ListBox>
                 <ListBoxItem Content="Item 1" />
                 <ListBoxItem Content="Item 2" />
                 <ListBoxItem Content="Item 3" />
             </ListBox>
         </StackPanel>
     </telerikControls:RadDropDownButton.DropDownContent>
 </telerikControls:RadDropDownButton>

This suggestion produces the following result:

If this approach is not applicable to your scenario, may I ask if you could share why is there a need to display a RadDropDownButton inside another one?

I hope the provided information will be of help to you.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Buttons
Asked by
Pavel Krebs
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or