I took your sample ListBoxInItemComboTemplate and modified to have the listbox populated with data from a datasource. That works fine. I need to add an item "ALL" and what I'm hoping to do is to check if the user selected "ALL" then turn off the other items in the listbox. Would that be done on the client side?
This is what I have. The listbox is inside an item template.
Also, I was trying to find out how many items I have selected in my listbox when the dropdown closes. The get_value() call works but the get_count() gives an error.
This client-side stuff is a little new for me. It's frustrating when you know what you want, but you struggle with a new language.
<
td
><
telerik:RadComboBox
ID
=
"ObjectiveCombo"
Runat
=
"server"
DataTextField
=
"ObjectiveName"
DataValueField
=
"ObjectiveID"
Skin
=
"Office2007"
Width
=
"487px"
OnClientDropDownClosed
=
"onObjectiveDDClosed"
>
<
Items
><
telerik:RadComboBoxItem
Text
=
""
/>
</
Items
>
<
ItemTemplate
>
<
div
id
=
"div1"
>
<
telerik:RadListBox
ID
=
"RadListBox1"
runat
=
"server"
Width
=
"100%"
SelectionMode
=
"Multiple"
OnClientSelectedIndexChanged
=
"onSelectedIndexChangedObjective"
DataSourceID
=
"ObjectiveDS"
DataTextField
=
"ObjectiveName"
DataValueField
=
"ObjectiveID"
>
</
telerik:RadListBox
>
</
div
>
<
script
type
=
"text/javascript"
>
var div1 = document.getElementById("div1");
div1.onclick = stopPropagation;
</
script
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
Also, I was trying to find out how many items I have selected in my listbox when the dropdown closes. The get_value() call works but the get_count() gives an error.
function onObjectiveDDClosed(sender, eventArgs) {
var text = "";
var value = "";
var comboBox = $find("<%= ObjectiveCombo.ClientID %>");
var items = comboBox.get_items().getItem(0).get_value();
var num = comboBox.get_items().getItem(0).get_count();
alert(num);
var total = items.split(",");
alert(total.length);
}