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

2 combobox interacting

4 Answers 40 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
hll
Top achievements
Rank 1
hll asked on 05 Nov 2008, 03:24 PM
Hi I've been trying to interact two combobox's. But could not find out how.

I have two combobox's like this:

<

telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="Office2007" EnableLoadOnDemand="true" HighlightTemplatedItems="true" DropDownWidth="150px" Width="150px"  onitemsrequested="RadComboBox1_ItemsRequested" />

 

<telerik:RadComboBox ID="RadComboBox2" runat="server" Skin="Office2007" EnableLoadOnDemand="true" HighlightTemplatedItems="true" DropDownWidth="150px" Width="150px"  onitemsrequested="RadComboBox2_ItemsRequested" />

I am filling their content in C# code.

 

private

void RadComboBox1_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
// fill first Combobox's content
}

 

How can i get the selected value of first combobox? because i need that to fill second combobox.

4 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 05 Nov 2008, 03:32 PM
Hello hll,

Please refer to our Multiple ComboBoxes example that shows the needed approach.

Kind regards,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
hll
Top achievements
Rank 1
answered on 05 Nov 2008, 04:09 PM
Thank you for quick reply !

I used the approach, but I dont know why, always I am getting item.get_index()  = 0 in this function:

function LoadCountries(combo, eventarqs)
{    
           var countriesCombo = $find("RadComboBox2");    
           var item = eventarqs.get_item();
                    
           if (item.get_index() > 0)
          {        
                countriesCombo.requestItems(item.get_value(), false);                                
          }
          else
          {
                // it always enters to this part.!!!!
                countriesCombo.set_text(" ");
                countriesCombo.clearItems();
                        
          }
}


I think i am missing something... But I could not find out.

0
hll
Top achievements
Rank 1
answered on 06 Nov 2008, 11:48 AM

What I understand is this:

I can not use that approach if i am using 
EnableLoadOnDemand="True" on my comboboxes.

I removed EnableLoadOnDemand="True" from my comboxes, and applied that approach. It worked well.

Is there a way to use EnableLoadOnDemand="True" and multiple - interacting combobxes at the same time??

 

Please reply... 

 

 

 

 

 

0
Yana
Telerik team
answered on 10 Nov 2008, 07:42 AM
Hello,

Please check the attached sample project which shows the needed approach.

Best wishes,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
hll
Top achievements
Rank 1
Answers by
Paul
Telerik team
hll
Top achievements
Rank 1
Yana
Telerik team
Share this question
or