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

Comobo hideDropDown and show

1 Answer 42 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 25 Sep 2011, 08:53 AM

This Dropdown in inside editformsettings

If down arrow is press at time only dropdown show other wise don't show,

That function combo box id not get there



<telerik:RadComboBox ID="Radcombo_Type" runat="server" Skin="Vista" Width="80%" SelectedValue='<%# Bind("datatype") %>'
                                                           MaxLength="6" OnClientDropDownOpening="HandleOpen"  >
                                                           <Items>
                                                               <telerik:RadComboBoxItem runat="server" Text="Client" Value="Client" />
                                                               <telerik:RadComboBoxItem runat="server" Text="Main Contractor" Value="ManCon" />
                                                               <telerik:RadComboBoxItem runat="server" Text="Sub Contractor" Value="SubCon" />
                                                               <telerik:RadComboBoxItem runat="server" Text="Supplier" Value="Supler" />
                                                               <telerik:RadComboBoxItem runat="server" Text="Consultant" Value="Consul" />
                                                               <telerik:RadComboBoxItem runat="server" Text="Service Provider" Value="SerPro" />
                                                           </Items>
                                                       </telerik:RadComboBox>



function HandleOpen(sender, args) {
                debugger;
                var combo = (sender.id);
                var key = window.event.keyCode;
                if (key == 40) {//backspace
                    args.set_cancel(true);
                    combo.showDropDown();
                }
                else {
                    combo.hideDropDown();
                    args.set_cancel(false);
                }
 
            }

Reply as soon as possible

Thanks,
Mohamed.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Sep 2011, 07:02 AM
Hi Mohamed,

I am not quite sure about your actual requirement.
Also I have found some mistakes in your code and I corrected that.
Please elaborate your scenario if it doesn't help.

JavaScript
<script type="text/javascript" language="javascript">
    function HandleOpen(sender, args)
     {
        var combo = (sender.get_id());
        var key = window.event.keyCode;
        if (key == 40)
        {
            args.set_cancel(true);
            sender.showDropDown();
        }
        else
        {
            sender.hideDropDown();
            args.set_cancel(false);
        }
    }
</script>

Also take a look into the following help article for more on ComboBox client side API
http://www.telerik.com/help/aspnet-ajax/combobox-client-side-basics.html

Thanks
Princy.
Tags
ComboBox
Asked by
mohamed
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or