
Esther Nirmala
Top achievements
Rank 1
Esther Nirmala
asked on 26 Apr 2010, 02:25 PM
Hi,
I am have radcombobox with checkbox items. I have javascript functions on the item chekbox check event. But if i click on the item it is getting selected. Actually i don need that feature. I need to perform the same checkbox check event even when the item clicked. Pls suggest me the better way of doing it.
Thanks,
Nimmi
I am have radcombobox with checkbox items. I have javascript functions on the item chekbox check event. But if i click on the item it is getting selected. Actually i don need that feature. I need to perform the same checkbox check event even when the item clicked. Pls suggest me the better way of doing it.
Thanks,
Nimmi
3 Answers, 1 is accepted
0
Hello Esther Nirmala,
The solution is to use ItemTemplates - CheckBox and Label as this:
To prevent the ComboBox of closing when you click on one of the items use this:
You may find the full code in the attached .zip file.
Hope this helps.
Regards,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
The solution is to use ItemTemplates - CheckBox and Label as this:
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
>
<
ItemTemplate
>
<
div
onclick
=
"StopPropagation(event)"
>
<
asp:CheckBox
runat
=
"server"
ID
=
"chk1"
Checked
=
"true"
onclick
=
"onCheckBoxClick(this)"
/>
<
asp:Label
runat
=
"server"
ID
=
"Label1"
AssociatedControlID
=
"chk1"
Text='<%# DataBinder.Eval(Container,"Text") %>'/>
</
div
>
</
ItemTemplate
>
<
Items
>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem1"
Value
=
"RadComboBoxItem1"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem2"
Value
=
"RadComboBoxItem2"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem3"
Value
=
"RadComboBoxItem3"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem4"
Value
=
"RadComboBoxItem4"
/>
</
Items
>
</
telerik:RadComboBox
>
To prevent the ComboBox of closing when you click on one of the items use this:
<script type=
"text/javascript"
>
function
StopPropagation(e)
{
//cancel bubbling
e.cancelBubble =
true
;
if
(e.stopPropagation)
{
e.stopPropagation();
}
}
</script>
You may find the full code in the attached .zip file.
Hope this helps.
Regards,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

Esther Nirmala
Top achievements
Rank 1
answered on 27 Apr 2010, 11:49 AM
Hi,
I tried that.. but even if i click the label its still displaying the text of label which is the data text property of rad combo item..
How to overcome this problem.. am creating the rad combo and template dynamically from code behind.. please suggest..
Thanks
Nimmi
I tried that.. but even if i click the label its still displaying the text of label which is the data text property of rad combo item..
How to overcome this problem.. am creating the rad combo and template dynamically from code behind.. please suggest..
Thanks
Nimmi
0
Hi Esther Nirmala,
Could you please provide your code so we can be able to help you?
Thank you!
Regards,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Could you please provide your code so we can be able to help you?
Thank you!
Regards,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.