Update Comboboxes 2+3 from change in ComboBox 1

3 posts, 0 answers
  1. Guillermo
    Guillermo avatar
    2 posts
    Member since:
    Jul 2010

    Posted 22 Oct 2010 Link to this post

    I have a page with with various input fields and  3 RadComboBox's. They are pre-populated with data  in the .cs code page

    I want to modify the page so that when the user changes the first RadComboBox, the other 2 are updated based on the selection made in the first.   Any help.

    .aspx.ca  code

    //Page event, raised on page load
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {  
         //Code pre-populated here. no problems.
    }


    .aspx page code

    <tr runat="server" id="Tr1">
                <td style="width: 120px;">Your PI/Approver
                    <asp:CompareValidator ID="piCompareValidator" runat="server" Text="*" ControlToValidate="piRadComboBox1" ValueToCompare="Select One..." Operator="NotEqual" ErrorMessage="Please select your P.I. in the 'Order Preferences' section"></asp:CompareValidator>
                </td>
                <td>
                    <telerik:RadComboBox ID="piRadComboBox1" Skin="Gray" Height="300px"
                        Width="202px" DataTextField="ListName" DataValueField="UserName" AppendDataBoundItems="true" EnableTextSelection="false" runat="server">
                        <items>
                            <telerik:RadComboBoxItem Text="Select One..." Value="Select One..." />
                        </items>
                    </telerik:RadComboBox>
                     <a href="#" rel="1" title="This order requires multiple approvers, add another." class="bdrLink jAdd">+ Add another PI/Approver</a> </td>
        </tr>
        <tr runat="server" id="Tr2">
                <td>Your Approver</td>
                <td>
                    <telerik:RadComboBox ID="piRadComboBox2" Skin="Gray" Height="300px" Width="202px" DataTextField="ListName" DataValueField="UserName" AppendDataBoundItems="true" EnableTextSelection="false" runat="server">
                        <items>
                            <telerik:RadComboBoxItem Text="Select One..." Value="Select One..." />
                        </items>
                    </telerik:RadComboBox>
     
                     <a href="#" rel="2" class="jRemove bdrLink">Remove</a> </td>
        </tr>
            <tr class="alt">
                <td style="width: 120px;">Your Purchaser </td>
                <td>
                    <telerik:RadComboBox ID="purchaserRadComboBox" Skin="Gray" Width="202px" DataTextField="ListName" DataValueField="UserName" AppendDataBoundItems="true" EnableTextSelection="false" runat="server">
                        <items>
                            <telerik:RadComboBoxItem Text="Select One..." Value="Select One..." />
                        </items>
                    </telerik:RadComboBox>
                    <asp:CompareValidator ID="purchaserCompareValidator" runat="server" Text="*" ControlToValidate="purchaserRadComboBox" ValueToCompare="Select One..." Operator="NotEqual" ErrorMessage="Please select your purchaser in the 'Order Preferences' section"></asp:CompareValidator>
                </td>
            </tr>


  2. Guillermo
    Guillermo avatar
    2 posts
    Member since:
    Jul 2010

    Posted 22 Oct 2010 Link to this post

    figured it out with javascript.  now im just trying to figure it out how to do it with ajax so the page doesnt refresh
  3. Yana
    Admin
    Yana avatar
    4796 posts

    Posted 28 Oct 2010 Link to this post

    Hi Guillermo,

    Have you checked our online example which demonstrates related ComboBoxes?

    Best wishes,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top