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

RadComboBox Clear

1 Answer 80 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Allan
Top achievements
Rank 2
Allan asked on 07 Sep 2012, 11:34 PM

I have a combo box that is set to AllowCustomText = "True", however, I just cant seem to get it to clear. Here is my code:

<telerik:RadComboBox ID="rcb_Users" Runat="server" AutoPostBack="True"
    DataSourceID="sds_UserList" DataTextField="UserName"  AllowCustomText = "True"
    DataValueField="UserName" EmptyMessage="Select User" Height="150px"
    Skin="WebBlue" EnableAutomaticLoadOnDemand="True" EnableVirtualScrolling="True"
    ItemsPerRequest="100" ShowMoreResultsBox="True" OnClientKeyPressing="HandleKeyPressUN">
</telerik:RadComboBox>


Private Sub ClearRCB_LUUserName()
 
    rcb_Users.ClearSelection()
    rcb_Users.Text = String.Empty
 
End Sub


Any help much appreciated.

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 10 Sep 2012, 08:33 AM
Hi Allan,

I have performed some tests based on the provided snippet of code, but could not replicate the experienced issue.
The code below works at our side:

ASPX
<div>
      <telerik:RadComboBox ID="rcb_Users" runat="server" AutoPostBack="True" DataSourceID="sds_UserList"
          DataTextField="VehicleName" AllowCustomText="True" DataValueField="ID" EmptyMessage="Select Vehicle"
          Height="150px" Skin="WebBlue" EnableAutomaticLoadOnDemand="True" EnableVirtualScrolling="True"
          ItemsPerRequest="100" ShowMoreResultsBox="True" _OnClientKeyPressing="HandleKeyPressUN">
      </telerik:RadComboBox>
      <asp:SqlDataSource ID="sds_UserList" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
          SelectCommand="SELECT [ID], [VehicleName] FROM [Vehicles]"></asp:SqlDataSource>
      <telerik:RadButton runat="server" ID="button" OnClick="ClearRCB_LUUserName" Text="Click Me">
      </telerik:RadButton>
  </div>

Code Behind:
Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub ClearRCB_LUUserName()
 
        rcb_Users.ClearSelection()
        rcb_Users.Text = String.Empty
 
    End Sub
End Class

Does it work at your side? If yes - could you please modify it so we can see the problem locally?

Kind regards,
Nencho
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.
Tags
ComboBox
Asked by
Allan
Top achievements
Rank 2
Answers by
Nencho
Telerik team
Share this question
or