I have a RadCombBox and RadButton like this:
And my code behind is set up like this:
When I step through the code, the event is fired properly, but box.CheckItems is always zero. Why is this? I need to be able to get all the values.
Thanks!
<
telerik:RadButton
runat
=
"server"
id
=
"btnPlantName"
OnClick
=
"btnPlantName_Click"
Text
=
"Filter"
/><
br
/>
<
label
for
=
""
class
=
"filterElement"
>Plant Name: </
label
>
<
telerik:RadComboBox
ID
=
"RadComboBoxPlantName"
DataSourceID
=
"SqlPlantNameList"
DataTextField
=
"PlantName"
DataValueField
=
"PlantName"
AppendDataBoundItems
=
"true"
runat
=
"server"
OnClientSelectedIndexChanged
=
"PlantIndexChanged"
class
=
"filterElement"
EnableLoadOnDemand
=
"false"
CheckBoxes
=
"true"
EnableCheckAllItemsCheckBox
=
"true"
>
</
telerik:RadComboBox
>
And my code behind is set up like this:
protected void btnPlantName_Click(object sender, EventArgs e)
{
FilterByComboBox(RadComboBoxPlantName, "PlantName");
}
private void FilterByComboBox(RadComboBox box, string columnName)
{
var selectedItems = box.CheckedItems;
List<
string
> values = new List<
string
>();
if (selectedItems.Count != 0)
{
foreach (var item in selectedItems)
values.Add(item.Text);
FilterColumnByMultipleValues(columnName, values.ToArray());
}
}
When I step through the code, the event is fired properly, but box.CheckItems is always zero. Why is this? I need to be able to get all the values.
Thanks!