How can I get the custom text to bind?

4 posts, 0 answers
  1. NT
    NT avatar
    5 posts
    Member since:
    Oct 2008

    Posted 03 Oct 2008 Link to this post

    Hi there,

    I am new to RadControls, and I have the problem as follows:

    I put a Rad Combobox in the detailview. This combobox is bound with Sqldatasource so that the users can choose a item from this dropdownlist to insert/update into the database. Everything works fine.

    But I also want to set to allow Custom text, and when users want something which is not in the list, they can type in the box whatever they want to create new items. But I cannot find how to bind this new typed items with the database. Nothing happens when I type new texts into the box.

    Please help.

    Thanks.
  2. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 03 Oct 2008 Link to this post

    Heya NT,

    Have you tried setting AllowCustomText=True on your combobox?  This should provide the desired functionality.  :)
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. NT
    NT avatar
    5 posts
    Member since:
    Oct 2008

    Posted 03 Oct 2008 Link to this post

    Thanks for your reply.

    Sure, I have set AllowCustomText="True". This allows me to type in the box perfectly. And I think my data binding is ok, because it works well when I choose items in the dropdownlist, but not with what I type in the box.

    Below is my code.


    <
    InsertItemTemplate>

    <telerik:RadComboBox ID="rcbAddMenuGroup" runat="server" AllowCustomText="True" AppendDataBoundItems="True" DataSourceID="SqlDataSourceAddMenuGroup" DataTextField="cMenuGroup" DataValueField="cMenuGroup" EmptyMessage="Gõ tên để tạo nhóm mới, hoặc chọn từ danh sách hiện có." EnableItemCaching="True" EnableVirtualScrolling="True" ErrorMessage="Error." Font-Names="Arial" Font-Size="X-Small" HighlightTemplatedItems="True" LoadingMessage="Loading..." MarkFirstMatch="True" OffsetY="5" Skin="Default2006" Sort="Ascending" Style="position: relative; top: 0px; left: 0px;" Width="500px" SelectedValue='<%# Bind("cMenuGroup") %>'>

    <CollapseAnimation Duration="200" Type="OutQuint" />

    </telerik:RadComboBox>

    </InsertItemTemplate>

  5. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 03 Oct 2008 Link to this post

    Hi NT,

    You can subscribe to TextChanged event of RadComboBox and update the database in its event handler.

    All the best,
    Rosi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top