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

3 posts, 0 answers
  1. dennis
    dennis avatar
    39 posts
    Member since:
    Jun 2008

    Posted 13 Jul 2009 Link to this post

    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"   
                                        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 : and there say that selectedvalue is supported.

    im using 2009 Q2..
    btw i also try with loadondemand="true"
  2. Simon
    Simon avatar
    2281 posts

    Posted 14 Jul 2009 Link to this post

    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,
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Jose
    Jose avatar
    49 posts
    Member since:
    Aug 2008

    Posted 14 Jul 2009 Link to this post

    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
Back to Top