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

3 Drop downs depending each other

1 Answer 44 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nani
Top achievements
Rank 2
Nani asked on 10 Apr 2013, 04:36 PM
Here the online solutions depending drop down not vice versa. I have there drop down , data populate using wcf service. Please consider my scenario 
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>

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 15 Apr 2013, 03:23 PM
Hi,

Try to call first combo's requestItems() method. This will automatically fire OnClientItemsRequesting and you will be able to get e.get_context(); in the same way as you did:
function OnClientDropDownOpening(sender, args) {
    var firstCombo = $('dropdown1');
    firstCombo.requestItems();
}

Regards,
Hristo Valyavicharski
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Nani
Top achievements
Rank 2
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or