title: Telerik AJAX radComboBox. Getting SelectedValue from second comboBox
body: <p>I’m trying to populate one Telerik AJAX radComboBox from the results of another i.e.</p>
  
  <ol>
  <li>comboBox1 – autocompletes and user selects an item </li>
  <li>comboBox2 – user
  selects. Loads on demand.  Uses the selected value from comboBox1 to
  populate itself.</li>
  </ol>
  
  <p>The problem is that I can’t get the selected value of combobox1</p>
  
  <p>Markup   </p>
  
  <pre><code>&lt;telerik:RadComboBox ID="comboBox1" runat="server" 
                   EnableLoadOnDemand="True" 
                   MarkFirstMatch="False" 
                   onitemsrequested="comboBox1_ItemsRequested" &gt;
              &lt;/telerik:RadComboBox&gt;
  
     &lt;telerik:RadComboBox ID="comboBox2" runat="server" 
                   EnableLoadOnDemand="True" 
                   MarkFirstMatch="False" 
                   onitemsrequested="comboBox2_ItemsRequested" &gt;
              &lt;/telerik:RadComboBox&gt;
  </code></pre>
  
  <p>C#</p>
  
  <pre><code>protected void comboBox1_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
  {
      //.. populate this combo
  }
  
  protected void comboBox2_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
  {
      string test = comboBox1.SelectedValue;
      //.. test is empty. Why?? 
  }
  </code></pre>
  
  <p>Frustratingly I can’t get the selected value.  The problem might be that the page isn’t actually posting back (must be part of the issue) so that selected value has no opportunity to be set. So I have written the code to get around this</p>
  
  <p>Markup</p>
  
  <pre><code>   &lt;telerik:RadComboBox ID="comboBox1" runat="server" 
                   EnableLoadOnDemand="True" 
                   MarkFirstMatch="False" 
                   onitemsrequested="comboBox1_ItemsRequested" 
    onclientselectedindexchanged="OnClientSelectedIndexChanged"&gt;
              &lt;/telerik:RadComboBox&gt;
     &lt;asp:HiddenField runat="server" ID="hidClientId" /&gt;
  
     &lt;telerik:RadComboBox ID="comboBox2" runat="server" 
                   EnableLoadOnDemand="True" 
                   MarkFirstMatch="False" 
  
                   onitemsrequested="comboBox2_ItemsRequested" &gt;
              &lt;/telerik:RadComboBox&gt;
  </code></pre>
  
  <p>JQuery</p>
  
  <pre><code>function OnClientSelectedIndexChanged(sender, eventArgs) {
  
           var item = eventArgs.get_item();
          var value = item.get_value();
          $("[ID$='hidClientId']").val(value);
  }
  </code></pre>
  
  <p>C#</p>
  
  <pre><code>protected void comboBox2_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
  {
      string test = hidClientId. Value;
      //.. test is empty. Why?? 
  }
  </code></pre>
  
  <p>This would seem to me to have bypassed the postback issue but it still doesn’t work.</p>
  
  <p>Does anyone know how to get the value of one radComboBox from another? Any help greatly appreciated</p>