1

I have this setup in my code:

<telerik:RadComboBox
    id="testBox"
    runat="server"
    AppendDataBoundItems="true"
    DataSourceID="test"
    DataTextField="LabID"
    CheckBoxes="true">
    <Items>
        <telerik:RadComboBoxItem Text="1" Value="1" />
        <telerik:RadComboBoxItem Text="2" Value="2" />
        <telerik:RadComboBoxItem Text="3" Value="3" />
    </Items>
</telerik:RadComboBox>
<telerik:RadButton runat="server" ID="btnTest" OnClick="btnTest_Click" Text="Filter" />

Using this RadComboBox and RadButton, I can select the items 1, 2, and 3 just fine. However, when I try to select the items from the DataSource, the CheckedItems property is always equal to zero.

public void btnTest_Click(object sender, EventArgs e)
{
    FilterByComboBox(testBox);
}

private void FilterByComboBox(RadComboBox box)
{
    var selectedItems = box.CheckedItems;
    //If I select items from the datasource, this will be zero.
}

Has anyone seen this behavior? How can I get the databound items to behave properly?

Thanks in advance!

Tony L.
  • 17,638
  • 8
  • 69
  • 66
Zach
  • 437
  • 3
  • 10
  • 27

0 Answers0