Editable ComboBox

4 posts, 0 answers
  1. Vitalii
    Vitalii avatar
    9 posts
    Member since:
    Jan 2013

    Posted 11 Jan 2013 Link to this post

    Hello, Telerik
    I have an RadComboBox:
    <telerik:RadComboBox runat="server" IsEditable="True" Width="167px" style="margin-left: 23px;" ID="cbMails" EmptyMessage="Choose a mail text"  OnSelectedIndexChanged="cbMails_SelectedIndexChanged" CssClass="ComboTop" AutoPostBack="True" meta:resourcekey="cbMailsResource1"></telerik:RadComboBox>

    And I have a button
     <asp:Button runat="server" ID="AddButton" Text="Add" CssClass="GreenContentButton"<br>                                    Width="60px" OnClick="AddButton_OnClick" meta:resourcekey="AddButtonResource1" />

    On button press I add new item in RadComboBox on server side.
    I want to be able to edit ComboBot item in it.
    I used IsEditable mode set to True but it does not work.
    In matter of fact it's not shown in intellitrace in regular Asp.Net.
    As far as I understood, it's available with silverlight and wpf versions of control. And by the logic in must be available in here, am I right?

    Please say I am)
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Jan 2013 Link to this post

    Hi,

    I suppose you want to allow the user to type in the input area of RadComboBox. You can set AllowCustomText property as true to achieve your scenario. Also check the following demo.
    ComboBox / Autocomplete

    Thanks,
    Princy
  3. Vitalii
    Vitalii avatar
    9 posts
    Member since:
    Jan 2013

    Posted 11 Jan 2013 Link to this post

    I did not write exactly what i want, sorry)

    I want user to be able to edit ComboBox item and save it on some button click.
  4. Nencho
    Admin
    Nencho avatar
    1874 posts

    Posted 16 Jan 2013 Link to this post

    Hello Vitalii,

    I can suggest you to use the FindItemByText() or FindItemByValue(), in order to access a specific item. Once you have an instance of the RadComboBoxItem, you could edit it and the changes would reflect immediately after the button Click event is fired. Please consider the following implementation at the OnClick event handler of the AddButton:

    protected void AddButton_Click(object sender, EventArgs e)
      {
          RadComboBoxItem item = cbMails.FindItemByText("item2");
          if (item != null)
              item.Text = "Item2Item2";
      }


    Greetings,
    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.
Back to Top