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

Check box text

1 Answer 116 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Naphtali
Top achievements
Rank 1
Naphtali asked on 06 Feb 2013, 08:45 AM
Hi,
I'm using the checkbox=true property for the RadComboBox.
Here is the code:

  <telerik:RadComboBox ID="cboApplication" runat="server" 

            CheckBoxes="true" EnableCheckAllItemsCheckBox="true">

            <Localization CheckAllString="All" AllItemsCheckedString="All" ItemsCheckedString="Items Selected" />

        </telerik:RadComboBox>

In code behind I fill in the values and set all items to selected.

My Problem is that after changing the selection (un selecting a few items) and closing the combobox, only the first item is displayed in the combobox.
I would like that all the selected items will be displayed.

Naphtali

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 11 Feb 2013, 08:05 AM
Hello Naphtali,

In order to set some initially checked items in RadComboBox input - you need to set the RadComboBoxItem.Checked property to "true":

<telerik:RadComboBox ID="RadComboBox1" runat="server" 
    CheckBoxes="true"
    EnableCheckAllItemsCheckBox="true">
    <Items>
        <telerik:RadComboBoxItem Text="item 1" Value="1" />
        <telerik:RadComboBoxItem Text="item 2" Value="2" />
        <telerik:RadComboBoxItem Text="item 3" Value="3" />
    </Items>
</telerik:RadComboBox>
protected void Page_Load(object sender, EventArgs e)
{
    this.RadComboBox1.FindItemByValue("1").Checked = true;
    this.RadComboBox1.FindItemByValue("2").Checked = true;
}

Greetings,
Kalina
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
Naphtali
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or