Link to home
Start Free TrialLog in
Avatar of Seven price
Seven priceFlag for United States of America

asked on

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.??
Avatar of Randy Downs
Randy Downs
Flag of United States of America image

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

Avatar of Seven price

ASKER

You do not think this is possible on the client side?
ASKER CERTIFIED SOLUTION
Avatar of Randy Downs
Randy Downs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks