This is a migrated thread and some comments may be shown as answers.

RadComboBox Multiple Select (with checkboxes) databinding problem

1 Answer 281 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
SilverLight
Top achievements
Rank 1
SilverLight asked on 15 Jun 2012, 10:25 AM
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

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 20 Jun 2012, 07:09 AM
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.
Tags
ComboBox
Asked by
SilverLight
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Share this question
or