I am very new to Telerik controls,
i am facing a problem where i have two RadDropDowns,while selecting the first dropdown,second dropdownlist is populated.
While in button click event i am not able to get second drop down selected value,eventhough dropdown is having values before the click event.
<rad:RadComboBox ID="RadComboBox1" runat="server" Width="200px" Height="115px" TabIndex="1"OnClientSelectedIndexChanging="LoadOrganizations" OnItemsRequested="RadComboBox1_ItemsRequested"EnableLoadOnDemand="True" AllowCustomText="False" ItemRequestTimeout="500" MarkFirstMatch="True">
<Items> </Items>
</rad:RadComboBox>
<rad:RadComboBox ID="RadComboBox2" runat="server" Width="200px" Height="115px" TabIndex="2"OnClientItemsRequested="ItemsLoaded"OnItemsRequested="RadComboBox2_ItemsRequested">
<Items></Items>
</rad:RadComboBox>
function LoadOrganizations(combo, eventarqs) {
var countriesCombo = $find("RadComboBox2");
var item = eventarqs.get_item();
countriesCombo.set_text("Loading...");
if (item.get_index() > 0) {countriesCombo.requestItems(item.get_value(), false); }
else {countriesCombo.set_text(" No Records Exist ");
countriesCombo.clearItems();}
}
function ItemsLoaded(combo, eventarqs) {
var countriesCombo = $find("RadComboBox2");
if (combo.get_items().get_count() > 0) {
combo.set_text(combo.get_items().getItem(0).get_text());
combo.get_items().getItem(0).highlight();
}else {
countriesCombo.set_text(" No Records Exist ");
countriesCombo.clearItems();
}
countriesCombo.commitChanges();
//combo.showDropDown(); }
C#
protected
void Page_Load(object sender, EventArgs e){
if (!IsPostBack){
LoadJurisdictions(); // ;db call for jurisdictions
RadComboBox1.Items.Insert(0, new RadComboBoxItem("- Select Jurisdiction -"));
}}
protected void RadComboBox1_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e){
LoadJurisdictions(); //dbcall for juris
}
protected void RadComboBox2_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e){
LoadOrg(e.Text);// db call for org
}
protected
void btnsubmit_Click(object sender, EventArgs e){
RadComboBoxItem r1 = RadComboBox1.SelectedItem;
RadComboBoxItem r2 = RadComboBox2.SelectedItem;
// getting null for r2
}