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

[Solved] SelectedValue

1 Answer 171 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Pablo Tola
Top achievements
Rank 2
Pablo Tola asked on 21 Jan 2008, 10:46 PM
I have two ComboBoxes on my page, I need to get the selected value from the first one on the ItemsRequested event of the second one server side, I'm getting null.

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 22 Jan 2008, 01:47 PM
Hi Pablo Tola,

I suggest to achieve your approach by hooking on OnClientItemsRequesting event of the second combo and setting the context property:

function OnClientItemsRequesting(sender,eventargs)  
                {  
                    var combo = $find("RadComboBox1");  //this is the first combo
                      
                    var c = eventargs.get_context();  
                    c["ComboValue"] =combo.get_value();  
                    c["ComboText"] =  combo.get_text();  
                } 

Then you can get these values in the ItemsRequested in the following way:
protected void RadComboBox2_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)  
        {  
            string value = e.Context["ComboValue"].ToString();  
            string text = e.Context["ComboText"].ToString();  
        } 

Hope this helps.

All the best,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Pablo Tola
Top achievements
Rank 2
Answers by
Rosi
Telerik team
Share this question
or