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

ComboBox items are not accessible on the server-side when loading them on demand

2 Answers 92 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
dennis
Top achievements
Rank 1
dennis asked on 13 Jul 2009, 03:49 PM
Hi,  im trying to access to the property selectedvalue in a combobox declared in this way:

                                <telerik:RadComboBox ID="RadComboBoxFlight" runat="server"   
                                    DataTextField="NU_VUEL" DataValueField="ID_VUEL_CLIE"   
                                    EmptyMessage="Seleccione&nbsp;una&nbsp;aerolinea..." Height="100px"   
                                    OnClientItemsRequested="ItemsLoaded"   
                                    OnItemsRequested="RadComboBoxFlight_OnItemsRequested" Skin="Web20"   
                                    Width="180" /> 

when i do postback with a button, the selectedvalue of the combobox returns an empty string, only works the text property.

 i chekc the support section of the combobox and i find this :
http://www.telerik.com/help/aspnet-ajax/load-on-demand-access-items-server-side.html and there say that selectedvalue is supported.

im using 2009 Q2..
btw i also try with loadondemand="true"

2 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 14 Jul 2009, 08:29 AM
Hi dennis,

I have just checked the latest version and the SelectedValue property worked fine in your use case.

Could you please verify that proper data is coming from the data base, i.e. the ID_VUEL_CLIE column is not empty?

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Jose
Top achievements
Rank 2
answered on 14 Jul 2009, 08:56 PM
Hi Dennis.

I found a similar issue using the ItemsRequested event, that's due the callback mode. My way to solve it was to use a separate hidden field and catch the current selected value in the OnClientSelectedIndexChanged event.

function RadComboBox1_ClientSelectedIndexChanged(sender, eventArgs) 
   var field = $get("hiddenFieldId"); 
   var item = eventArgs.get_item(); 
   field.value = item.get_value(); 

in your code behind, just check for the value in the hidden field.

Hope this helps.
Jose Guay
Tags
ComboBox
Asked by
dennis
Top achievements
Rank 1
Answers by
Simon
Telerik team
Jose
Top achievements
Rank 2
Share this question
or