how we use radcombobox using checkbox selection and background change on dropdown please tell me

Posted by Harbans under Silverlight on 1/23/2012 | Points: 10 | Views : 5860 | Status : [Member] | Replies : 1
how we use radcombobox using checkbox selection and background change on dropdown please tell me




Responses

Posted by: Jawed_akhtar786 on: 1/24/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Try this
Aspx

<telerik:RadComboBox TabIndex="2" ID="cmbPARole" runat="server" DataValueField="ID"
DataTextField="name" EmptyMessage="All Roles" AllowCustomText="true" EnableScreenBoundaryDetection="false"
Width="240px" OnClientDropDownClosed="onDropDownClosing" EnableTextSelection="false">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chk1" onclick="onCheckBoxClick(this)" Text='<%# DataBinder.Eval(Container.DataItem, "name") %>' />
</ItemTemplate>
</telerik:RadComboBox>
JavaScript
function onCheckBoxClick(chk) {
var combo = $find("<%= cmbPARole.ClientID %>");
var items = combo.get_items();
var text = "";
var values = "";
for (var i = 0; i < items.get_count(); i++) {
var item = items.getItem(i);

//get the checkbox element of the current item
var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");
if (chk1.checked) {
text += item.get_text() + ",";
values += item.get_value() + ",";
//Here you can add you background change property
}
}



}

Harbans, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response