radcombo box AllowCustomText not working

4 posts, 1 answers
  1. Kris
    Kris avatar
    5 posts
    Member since:
    Jan 2012

    Posted 20 Mar 2012 Link to this post

    Hello, i am trying to use the allowcustomtext feature on the radcombo box, but whether i set the property in the code behind or the code front it fails to work.  All other properties appear to work OK. When I tried setting the property in the code behind under "selected index change" obviously same results.  Basically when i attempt to select a word(s) it selects everything and in order to modify the suggested value you have to use the "end" key then scroll left, end users are complaining.. please help.
    <telerik:RadComboBox ID="cbActivity" runat="server" Skin="Windows7"
                       EnableLoadOnDemand="true" MarkFirstMatch="true" 
                       EnableVirtualScrolling="True" DataSourceID="SqlDataSource1" 
                       DataTextField="Activity" DataValueField="Activity" 
                       EmptyMessage="Enter New Activity or Select Pre-Existing" 
                       style="margin-bottom: 0px" Width="500px" AllowCustomText="true"
                       HighlightTemplatedItems="true" ShowMoreResultsBox="true">
                   </telerik:RadComboBox>
    attempt using code behind
    protected void cbActivity_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            cbActivity.AllowCustomText = true;
        }
  2. Answer
    Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 22 Mar 2012 Link to this post

    Hi Kris,

    The EnableLoadOnDemand property allows the user to enter text in the input area, regardless of the value of the AllowCustomText property. For more information you could refer to the following help article: 
    http://www.telerik.com/help/aspnet-ajax/combobox-load-on-demand-overview.html.

    If you want to stop the AutoComplete of RadComboBox, you just need to set the MArkFirstMatch property to false.

    What exactly is the behavior that you want to achieve?

    Kind regards,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Kris
    Kris avatar
    5 posts
    Member since:
    Jan 2012

    Posted 22 Mar 2012 Link to this post

    thanks for responding, basically i want to edit the text.  When you start typing and you select one of the suggestions, lets say i am looking for thank you card greetings, and i type "thanks for b..." and its suggests "thanks for the birthday gift" i want to select a word(s) say "birthday" and change it to "christmas"...All you demos i've seen allow this behavior but for whatever reason it wont let me change "bithday"!!  When i double click It will select the entire phrase, then i have to press the "end" button on the keyboard and then scroll left "backspace out the undesirable word then type in the new word.  pain in *&%$!  Please help!   BTW i used your code although it produced a better result, it still doesn't accomplish what we need and what i hope i am describing. 
    RadComboBox combo = (RadComboBox)o;
    string sql = @"SELECT Activity, inserted FROM billSlips WHERE (Activity LIKE '" + e.Text + "%') ORDER BY inserted DESC, Activity";
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["sjhConnection"].ConnectionString);
    conn.Open();
    SqlCommand cmd = new SqlCommand(sql, conn);
    SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
    DataTable dt = new DataTable();
    adapter.Fill(dt);
    conn.Close();
    foreach (DataRow row in dt.Rows)
    {
        RadComboBoxItem item = new RadComboBoxItem(row["Activity"].ToString());
        combo.Items.Add(item);
    }
     aspx
    <td class="style10" colspan="2">
                    Enter Activity Information:<br />
                    <telerik:RadComboBox ID="cbActivity" runat="server" Skin="Windows7"
                    EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                    EnableVirtualScrolling="true" 
                    EmptyMessage="Enter New Activity or Select Pre-Existing" 
                    style="margin-bottom: 0px" Width="500px" 
                    onitemsrequested="cbActivity_ItemsRequested">
                    </telerik:RadComboBox>
                </td>
  4. Kris
    Kris avatar
    5 posts
    Member since:
    Jan 2012

    Posted 26 Mar 2012 Link to this post

    Thanks again, tinkering around with it i figured it out!
Back to Top