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

radtoolbar button closes on child click

1 Answer 102 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Doug R
Top achievements
Rank 1
Doug R asked on 26 Oct 2010, 06:15 PM
Please see attached. When I click on the dropdown list inside the radtoolbarbutton itemtemplate, the entire toolbarbutton closes. How do I keep it open? I only want it to close if the user clicks outside of the radtoolbarbutton area.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 28 Oct 2010, 01:54 PM
Hi Doug,

Here is a simple solution of this issue:

- subscribe to OnClientDropDownClosing event of the toolbar and cancel it in case a combobox item is clicked:

<telerik:RadToolBar ID="RadToolBar1" runat="server" OnClientDropDownClosing="dropDownClosing">
    <Items>
        <telerik:RadToolBarDropDown>
            <Buttons>
                <telerik:RadToolBarButton Text="item1">
                    <ItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text="test test" />
                        <telerik:RadComboBox ID="RadCOmboBox1" runat="server" ZIndex="9001">
                            <Items>
                                <telerik:RadComboBoxItem Text="item1" />
                                <telerik:RadComboBoxItem Text="item2" />
                            </Items>
                        </telerik:RadComboBox>
                    </ItemTemplate>
                </telerik:RadToolBarButton>
            </Buttons>
        </telerik:RadToolBarDropDown>
    </Items>
</telerik:RadToolBar>

and here is the event handler:

function dropDownClosing(sender, args) {
    if (args.get_domEvent().srcElement.className.indexOf("rcbHovered") > -1)
        args.set_cancel(true);
}

Regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ToolBar
Asked by
Doug R
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or