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

[Solved] RadComboBox ItemsRequested if DropDown Image Clicked

4 Answers 216 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
jgig
Top achievements
Rank 1
jgig asked on 19 Dec 2008, 09:14 PM
I want to set up my RadComboBox dropdown where it does not appear unless they click the dropdown image. I also have to LoadonDemand because I will be using Linq to read a XML file with over 3000 airport Codes. Additionally I will have several of these in a repeater. At least 2 for round trip and many more for a multiple stop itinerary

So if the user types text in the textbox I want the dropdown to stay closed. If they click the dropdown I want to Load Items on Demand and I will filter those by the text they have entered in the textbox. also if the drop down is aleady OPEN and they modify the text refilter the Items. I know this is different because it is usually one way or the other. Is this possible?

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 22 Dec 2008, 09:43 AM
Hi there,

I suggest you subscribe to OnClientDropDownOpening event and in its handler cancel the opening if the input field of the combo is clicked like this:

<script type="text/javascript">  
    function OnClientDropDownOpening(sender, args)  
    {  
        var ev = args.get_domEvent();  
        if(ev == null || args.get_domEvent().target.className == "rcbInput")  
            args.set_cancel(true);  
    }  
</script> 

I hope this helps.

Kind regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
jgig
Top achievements
Rank 1
answered on 22 Dec 2008, 04:20 PM
PERFECT!

that is exactly what I was trying to get accomplished. (a little surprised there wasnt a cleaner way where your not using a class name to accomplish this though) My combobox is more for help than anything. Now if they want to use it they can but it wont hinder the user from filling out the form rapidly
0
jgig
Top achievements
Rank 1
answered on 30 Jul 2009, 10:21 PM
this apparently is not supported anymore with the new DLL - args.get_domEvent().target.className
Is there a  better way so this will continue to work. I tried setting ShowDropDownOnTextboxClick="false" but when I start typing it still opens the drop down. I only want to open the drop down IF they click the arrow.

I am using Telerik.Web.UI, Version=2009.2.701.35,

thanks for you help
0
Veselin Vasilev
Telerik team
answered on 05 Aug 2009, 08:27 AM
Hello jgig,

I suppose the method was working in Firefox only with the old version. Please use this one for both IE and Firefox:

<script type="text/javascript"
    function onDropDownOpening(sender, args) { 
        var ev = args.get_domEvent(); 
        if (ev) { 
            var target = ev.target || ev.srcElement; 
            if (target.id == sender.get_id() + "_Input"
                args.set_cancel(true); 
        } 
        else args.set_cancel(true); 
    } 
</script> 

I hope this helps.

Greetings,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ComboBox
Asked by
jgig
Top achievements
Rank 1
Answers by
Yana
Telerik team
jgig
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or