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

RadCombo in Toolbar

2 Answers 143 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Imran
Top achievements
Rank 1
Imran asked on 30 Apr 2010, 12:32 AM
Hello

I have a RadCombo in the template for a RadToolBarButton in the RadToolBarDropDown.

I want to allow the user to make a selection from the Combo Box and then have him click the RadToolBarButton to perform the post back.

As soon as a selection is made from the combo box the RadToolBarDropDown closes. 

I want to be able to leave the RadToolBarDropDown open after a selection has been made in the combo box and hence avoid an extra click which is currently needed to reopen RadToolBarDropDown. 

I have attached the image with this message.

Any insight will be greatly appreciated.

Thanks
Imran

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 05 May 2010, 10:01 AM
Hello Imran,

You should use OnClientDropDownOpening and OnClientDropDownClosed events of the combobox to mark whether the dropdown button should be closed like this:

<telerik:RadToolBar ID="RadToolBar1" runat="server" OnClientDropDownClosing="dropDownClosing">
    <Items>
        <telerik:RadToolBarDropDown Text="dropdown">
            <Buttons>
                <telerik:RadToolBarButton Text="dropdown 1" />
                <telerik:RadToolBarButton>
                    <ItemTemplate>
                        <telerik:RadComboBox ID="RadComboBox1" runat="server"  OnClientDropDownOpening="dropDownOpening"
                            OnClientDropDownClosed="dropDownClosed">
                            <Items>
                                <telerik:RadComboBoxItem Text="item1" />
                                <telerik:RadComboBoxItem Text="item2" />
                                <telerik:RadComboBoxItem Text="item3" />
                            </Items>
                        </telerik:RadComboBox>
                    </ItemTemplate>
                </telerik:RadToolBarButton>
            </Buttons>
        </telerik:RadToolBarDropDown>
    </Items>
</telerik:RadToolBar>

and the needed javascript:

<script type="text/javascript">
    var shouldClose = true;
 
    function dropDownOpening(sender, args) {
        shouldClose = false;
    }
 
    function dropDownClosed(sender, args) {
        shouldClose = true;
    }
 
    function dropDownClosing(sender, args) {
        if (!shouldClose)
            args.set_cancel(true);
    }
</script>


Greetings,
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.
0
Imran
Top achievements
Rank 1
answered on 05 May 2010, 05:04 PM
Sweet it worked like a charm. Thanks.
Tags
ToolBar
Asked by
Imran
Top achievements
Rank 1
Answers by
Yana
Telerik team
Imran
Top achievements
Rank 1
Share this question
or