RadComboBox Multiple Select (with checkboxes) databinding problem

2 posts, 0 answers
  1. SilverLight
    SilverLight avatar
    5 posts
    Member since:
    May 2012

    Posted 15 Jun 2012 Link to this post

    hi dear telerik admin,
    please see this thread : 
    RadComboBox Advanced Multiple Selection

    and this is my RadComboBox :

    <telerik:RadComboBox ID="radcbFrom" runat="server" DataSourceID="sdsFrom_WebSites"
        DataTextField="From_WebSite" DataValueField="From_WebSite" EnableEmbeddedSkins="false"
        Skin="BlackByMe" ValidationGroup="A" Width="240px" LoadingMessage="Loading ..."
        CausesValidation="False" MaxHeight="150px" AppendDataBoundItems="True" HighlightTemplatedItems="true"
        OnClientDropDownOpening="OnClientDropDownOpening" OnClientDropDownClosing="OnClientDropDownClosing"
        OnClientSelectedIndexChanging="OnClientSelectedIndexChanging" OnClientBlur="OnClientBlur">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="All" Value="-1" />
        </Items>
        <ItemTemplate>
            <asp:CheckBox runat="server" ID="CheckBox" onclick="checkboxClick();" Text='<%# DataBinder.Eval(Container, "Text") %>' />
        </ItemTemplate>
    </telerik:RadComboBox>

    all of my server and client side codes are like that example.
    my problem is when my page is loaded there is no "All" text next it's check box. 
    what is the problem and how can i fix? 
    as you see my radcombobox is a little different from that example.
    in my situation there is sql datasource and AppendDataBoundItems="True"

    thanks in advance
  2. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 20 Jun 2012 Link to this post

    Hi Silver,

    As of Q2 2011, RadComboBox introduces a built-in CheckBox support. Using this functionality you will be able to define items in the markup and append the ones from the database to them. This way you don't have to deal with the text in the input area as this is all taken care of by the CheckBox functionality.

    Here is an example:
    <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="SqlDataSource1"
        DataTextField="Name" DataValueField="ID"
        MaxHeight="150px" AppendDataBoundItems="true"
        CheckBoxes="true">
        <Items>
            <telerik:RadComboBoxItem Text="All" />
        </Items>
    </telerik:RadComboBox>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
        SelectCommand="SELECT [ID], [CountryID], [Name] FROM [Cities]"></asp:SqlDataSource>

    I hope this will help.

    All the best,
    Ivana
    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