telerik:RadComboBox

<telerik:RadComboBox 

Open in new window

http://demos.telerik.com/aspnet-ajax/combobox/examples/overview/defaultcs.aspx

Is there a way to append text or in angular type text in one text box and have it show up in the RadComboBox.??
LVL 9
Seven priceFull StackAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
maybe this will work.

<telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="Vista">
            <FooterTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:Button ID="Button1" runat="server" Text="Add Country" OnClick="Button1_Click" />
            </FooterTemplate>
            <Items>
                <telerik:RadComboBoxItem runat="server" Text="Bulgaria" Value="Bulgaria" />
                <telerik:RadComboBoxItem runat="server" Text="USA" Value="USA" />
                <telerik:RadComboBoxItem runat="server" Text="Germany" Value="Germany" />
                <telerik:RadComboBoxItem runat="server" Text="India" Value="India" />
                <telerik:RadComboBoxItem runat="server" Text="Canada" Value="Canada" />
            </Items>
        </telerik:RadComboBox>

Open in new window



code-behind:
protected void Button1_Click(object sender, EventArgs e)
   {
       TextBox txt = (TextBox)RadComboBox1.Footer.FindControl("TextBox1");
       if ((!String.IsNullOrEmpty(txt.Text))&&(RadComboBox1.FindItemByText(txt.Text) == null))
       {
           RadComboBox1.Items.Insert(0, new RadComboBoxItem(txt.Text));
           RadComboBox1.SelectedIndex = 0;
           txt.Text = String.Empty;
       }
   }

Open in new window

Seven priceFull StackAuthor Commented:
You do not think this is possible on the client side?
Randy DownsOWNERCommented:
Sorry I didn't notice you were looking for JavaScript. Maybe this post will give you some insight.

function BindListToCombo(cbo, list) {
   $find(cbo).clearItems();
   $.each(list, function (a, item) {
      var comboItem = new Telerik.Web.UI.RadComboBoxItem();
      comboItem.set_text(item.Name);
      comboItem.set_value(item.Id);
      $find(cbo).get_items().add(comboItem);
});
var comboItem = $find(cbo).findItemByValue(0);
comboItem.select();} 

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seven priceFull StackAuthor Commented:
thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.