Hello,
I am using Rad combo box control and I want to populate it, initially, with only one default option and upon clicking on the drop-arrow image to populate the remaining items. However, it looks like the ItemsRequested event is not fired when there is one item in the combo box (the event is fired when there aren’t any items in the control).
Is there a way to get this event fired in my scenario?
Thanks,
Ivo
I am using Rad combo box control and I want to populate it, initially, with only one default option and upon clicking on the drop-arrow image to populate the remaining items. However, it looks like the ItemsRequested event is not fired when there is one item in the combo box (the event is fired when there aren’t any items in the control).
Is there a way to get this event fired in my scenario?
Thanks,
Ivo
4 Answers, 1 is accepted
0
Hello Ivo,
You can do the following to accomplish the task.
Hook on the Sys.Application.load event, like:
<script>
function pageLoad()
{
var combo = $find("<%=RadComboBox1.ClientID%>");
//get the image DOM element and wire its click event
var imageDOM = combo.get_imageDomElement();
imageDOM.onclick = function(){ var combo = $find("<%=RadComboBox1.ClientID%>"); combo.RequestItems();}
}
</script>
Hope this helps.
Regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can do the following to accomplish the task.
Hook on the Sys.Application.load event, like:
<script>
function pageLoad()
{
var combo = $find("<%=RadComboBox1.ClientID%>");
//get the image DOM element and wire its click event
var imageDOM = combo.get_imageDomElement();
imageDOM.onclick = function(){ var combo = $find("<%=RadComboBox1.ClientID%>"); combo.RequestItems();}
}
</script>
Hope this helps.
Regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Ivo
Top achievements
Rank 1
answered on 10 Mar 2008, 01:19 PM
Hi Nik,
Thank you for the quick response.
I tried the code, but I got object not supported JavaScript error on combo.RequestItems() call.
Thanks,
Ivo
Thank you for the quick response.
I tried the code, but I got object not supported JavaScript error on combo.RequestItems() call.
Thanks,
Ivo
0
Accepted
Hi Ivo,
The correct syntax is this:
You can use another approach also:
Hook on the OnClientDropDownOpening event and invoke the requestItems method there.
I hope this helps.
Regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The correct syntax is this:
| function pageLoad() |
| { |
| var combo = $find("<%=RadComboBox1.ClientID%>"); |
| //get the image DOM element and wire its click event |
| var imageDOM = combo.get_imageDomElement(); |
| imageDOM.onclick = function(){ var combo = $find("<%=RadComboBox1.ClientID%>"); |
| combo.requestItems("", false);} |
| } |
You can use another approach also:
Hook on the OnClientDropDownOpening event and invoke the requestItems method there.
| function onDropDownOpening(sender, eventArgs) |
| { |
| sender.requestItems("", false); |
| } |
I hope this helps.
Regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Ivo
Top achievements
Rank 1
answered on 11 Mar 2008, 02:36 AM
Works perfect!
Thanks a lot!
Thanks a lot!
