RadComboBox text is always empty

3 posts, 0 answers
  1. Anne
    Anne avatar
    39 posts
    Member since:
    May 2010

    Posted 20 Jul 2010 Link to this post


    I work with vs 2008 and IE8.

    I have a simple RadComboBox with a button.
    If I tape a text in my RadComboBox, when I click on the button, the RadComboBox still always empty.

    Code aspx :

           <telerik:RadComboBox ID="RcmbPref" runat="server" DataSourceID="ds_pref" AutoPostBack = "true" AllowCustomText="true"  DataTextField="IDFavori" DataValueField="IDFavori" Skin="WebBlue" MarkFirstMatch="True">
         <td width="6px"> </td>
            <asp:ImageButton ID="ImgBtn_pref" runat="server" ImageUrl="../Gen_Images/favorites_add.png" ToolTip="Ajouter une préférence d'affichage" />



    asp:SqlDataSource ID="ds_pref" runat="server"



    ConnectionString="<%$ ConnectionStrings:CsAppli %>"



    SelectCommand="SELECT IDFavori FROM t_preferenceRadGrid WHERE (IDApplication = 'CEC') AND (IDSection = 'listeCL') ORDER BY IsCurrent DESC"></asp:SqlDataSource>


    Code VB :
    Private Sub ImgBtn_pref_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImgBtn_pref.Click
            Dim sNomPref As String = ""
            sNomPref = RcmbPref.Text
    End Sub

    Someone can see where is the problem, please ?

  2. Helen
    Helen avatar
    1052 posts

    Posted 23 Jul 2010 Link to this post

    Hello Anne,

    What is the exact problem - sNomPref string is empty or text in the RadComboBox input is empty?
    If the sNomPref string is empty, could you try to remove the AutoPostBack=true from the RadComboBox declaration.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Anne
    Anne avatar
    39 posts
    Member since:
    May 2010

    Posted 23 Jul 2010 Link to this post

    Thanks Helen for your answer

    When I debug, RcmbPref.Text is empty but the input of ComboBox on the screen is not empty.

    I think I found the problem.

    I use a RadFilter and I want to use a comboBox to save or choose user's preferences. The preferences are save in a database (SQL server).
    I think there is an incompatibility between autocomplete and SelectedIndexChanged.
    When a user write a text in the combobox, the programm go in the SelectedIndexChanged and I don't know if it's a choise or text writted.




    Private Sub RcmbPref_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RcmbPref.SelectedIndexChanged
        If Trim(RcmbPref.SelectedValue) <> "" Then
            Dim prefCurrent As UserPreferenceRadGrid
            prefCurrent = New UserPreferenceRadGrid(MyUser, MyApplication, MyPage, Trim(RcmbPref.SelectedValue))
            Dim SprefUser As String
            SprefUser = prefCurrent.load
            Dim LoadPersister As New GridSettingsPersister(MyRadGrid)
        End If
    End Sub

    So I create a textBox for new preference and I use ComboBox for choose preference only.
Back to Top