http://www.telerik.com/demos/aspnet/prometheus/ComboBox/Examples/Functionality/MultipleComboBoxes/DefaultCS.aspx
This is what I have
<rad:RadComboBox ID="radDdlOccassion" runat="server" NoWrap="false" LoadingMessage="Loading..." Skin="Vista" Width="210px"
OnClientSelectedIndexChanged="loadSentiment" OnItemsRequested="radDdlOccassion_ItemsRequested">
</rad:RadComboBox>
<br />
<label class="personalize_label">Sentitment:</label>
<rad:RadComboBox ID="radDdlSentitment" runat="server" NoWrap="false" LoadingMessage="Loading..." Skin="Vista" Width="210px"
>
</rad:RadComboBox>
Protected Sub radDdlOccassion_ItemsRequested(ByVal o As Object, ByVal e As _radWebUi.RadComboBoxItemsRequestedEventArgs) Handles radDdlOccassion.ItemsRequested
'Local variables
'Local constants
Const cstrPROC_FUNC_NAME As String = _cstrMODULE_NAME & ".radDdlOccassion_ItemsRequested"
'Try it out
Try
LoadSentitment(e.Value)
Catch ex As Exception
_strErrMsg &= _ErrorHandler.BuildErrorMsg(cstrPROC_FUNC_NAME, ex.Message & Environment.NewLine & ex.StackTrace)
Finally
End Try
End Sub
And in my external js file I have the following function
function
loadSentiment(combo, eventarqs) {
var radDdlSentitment = $find("radDdlSentitment");
var item = eventarqs.get_item();
radDdlSentitment.set_text(
"Loading...");
if (item.get_index() > 0) {
radDdlSentitment.requestItems(item.get_value(),
false);
}
else {
radDdlSentitment.set_text(
" ");
radDdlSentitment.clearItems();
}
}
I am not getting any js errors, but the itemsrequested event of my first dropdown is not being fired....so any help on this would be appreciated.
8 Answers, 1 is accepted
There is other radcomboboxes on the form that are not causing a postback, so little confused as to what is causing this. I have read some of the articles in this formum to use a Webservice. Would much rather not have to do that, so any ideas on what I can do to fix this would be appreciated. Thanks.
The problem is that you have attached the radDdlOccassion combo to OnItemsRequested event but call requestItems method of second combo(radDdlSentitment).
I suggest you hook the OnItemsRequested="radDdlOccassion_ItemsRequested" to the radDdlSentitment and try it.
Regards,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
So either I am messing it up or it doesn't behave the way I would expect it to, kind of frustrating right now. Because I really want to use this control for this page, and not have to have to rewrite something for dynamic combox, the control works very nicely for what I want and looks pretty good on the page.
That said, if I don't solve this problem today or tomorrow at the latest, then I will have to rewrite that part of the page to handle what I want. :)
As I said, I did make the change you suggested and put a break point on the event, and sadly it was never fired. So if you have any ideas on this I would really appreciate it. Thanks.
We will be happy to help you solve this issue. Please open a support ticket and send us a sample running project illustrating the problem. This will really help us understand the problem better and provide you with more specific instructions.
Regards,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I was wondering if there was an outcome of this request? I too am trying to build a filtered cascading drop down i.e. select a country then a state then a city then a Zip. And I notice that filtering is a new feature so am very curious as to how to implement this.
Thanks very much
Tim
Please find our online example. Also you can set the Filter property to any of this comboboxes and let us know how this goes.
Regards,
Rosi
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I followed the online example to cascade RadComboBox and when I try to set the OnItemsRequested to my RadComboBox it complains that I cannot access that because of its protection level. Do you have an alternate for this?
Thanks
Suj
Step 1 : i am requesting first drop downs values ( OnClientItemsRequesting="OnClientItemsRequesting" ) i am getting 500 records.
function OnClientItemsRequesting(sender, e) {
var context = e.get_context();
context["UpdateKeys"] = UpdateKeys();// thjis function give 3 dropdown selected value
}
Step 2: I am requesting second drop downs values now i am getting 400 records ( these 400 records are depending values on first drop down )
Step 3: I am requesting third drop downs values now i am getting 300 records ( these 400 records are depending values on first & second drop downs )
Step 4: Now i am again requesting First drop down values . This time i need to get only 50(which are depending on 2&3 drop downs). i am update getting 50 records when i am start type on drop down text box.
But i need to update when i open drop down. Here have client event OnClientDropDownOpening or OnClientDropDownOpened. But this event doesn't have e.get_context(); and all auto wcf calling like OnClientItemsRequesting event.
<
telerik:RadComboBox
runat
=
"server"
ID
=
"dropdown1"
CloseDropDownOnBlur
=
"true"
EnableAjaxSkinRendering
=
"true"
EnableTextSelection
=
"true"
ShowWhileLoading
=
"true"
EnableLoadOnDemand
=
"true"
OnClientItemsRequesting
=
"OnClientItemsRequesting"
ShowMoreResultsBox
=
"true"
MinFilterLength
=
"3"
EnableVirtualScrolling
=
"true"
EmptyMessage
=
"Type refresh values..."
Width
=
"380"
Height
=
"250"
>
<
WebServiceSettings
Path
=
"/Services/service.svc"
Method
=
"FillFristDrop"
/>
</
telerik:RadComboBox
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"dropdown2"
CloseDropDownOnBlur
=
"true"
EnableAjaxSkinRendering
=
"true"
EnableTextSelection
=
"true"
ShowWhileLoading
=
"true"
EnableLoadOnDemand
=
"true"
OnClientItemsRequesting
=
"OnClientItemsRequesting"
ShowMoreResultsBox
=
"true"
MinFilterLength
=
"3"
EnableVirtualScrolling
=
"true"
EmptyMessage
=
"Type refresh values..."
Width
=
"380"
Height
=
"250"
>
<
WebServiceSettings
Path
=
"/Services/service.svc"
Method
=
"FillSecondDrop"
/>
</
telerik:RadComboBox
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"dropdown3"
CloseDropDownOnBlur
=
"true"
EnableAjaxSkinRendering
=
"true"
EnableTextSelection
=
"true"
ShowWhileLoading
=
"true"
EnableLoadOnDemand
=
"true"
OnClientItemsRequesting
=
"OnClientItemsRequesting"
ShowMoreResultsBox
=
"true"
MinFilterLength
=
"3"
EnableVirtualScrolling
=
"true"
EmptyMessage
=
"Type refresh values..."
Width
=
"380"
Height
=
"250"
>
<
WebServiceSettings
Path
=
"/Services/service.svc"
Method
=
"FillThirdDrop"
/>
</
telerik:RadComboBox
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
function OnClientItemsRequesting(sender, e) {
var context = e.get_context();
context["UpdateKeys"] = UpdateKeys();
}
function UpdateKeys() {
return values // return remaing 2 dropdown selected value
}
</
script
>