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

Update Comboboxes 2+3 from change in ComboBox 1

2 Answers 66 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Guillermo
Top achievements
Rank 1
Guillermo asked on 22 Oct 2010, 05:55 PM
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 Answers, 1 is accepted

Sort by
0
Guillermo
Top achievements
Rank 1
answered on 22 Oct 2010, 07:43 PM
figured it out with javascript.  now im just trying to figure it out how to do it with ajax so the page doesnt refresh
0
Yana
Telerik team
answered on 28 Oct 2010, 07:36 AM
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
Tags
ComboBox
Asked by
Guillermo
Top achievements
Rank 1
Answers by
Guillermo
Top achievements
Rank 1
Yana
Telerik team
Share this question
or