This is a migrated thread and some comments may be shown as answers.

Prevent RadComboBox closing after checkbox item has been clicked (codebehind)

3 Answers 413 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
A W
Top achievements
Rank 1
A W asked on 11 Jun 2010, 04:39 AM
I have created a custrom combobox with checkboxes in codebehind, as detailed in my blog post here:

http://andrewwhitten.wordpress.com/2010/05/15/multiple-select-telerik-radcombobox-in-code-behind/

This works well, but I can't seem to apply the correct Javascript in order to prevent the RadComboBox closing directly after a checkbox has been clicked.

Can anyone tell me how to use Javascript to achieve this? (something like the Telerik StopPropagation() example)

Many thanks in advance!

Andrew Whitten

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 11 Jun 2010, 11:05 AM
Hello Andrew,

Have you tried attaching 'OnClientDropDownClosing' To RadComboBox? Cancel the event using args.set_cancel(true) method if clicked on checkbox, otherwise do not execute the code args.set_cancel(true), which in turn closes the dropdown.

Thanks,
Princy.
0
A W
Top achievements
Rank 1
answered on 12 Jun 2010, 10:55 AM
Thanks Princy!

Here is the exact script I ended up using (based on your advice)

function OnClientDropDownClosing(sender, eventArgs) { if( eventArgs.get_domEvent().type == 'click' ) { eventArgs.set_cancel(true);  } }

It seems to work for me, since all mouse clicks outside of the combobox have the DOM event of 'mousedown'.
0
Smiely
Top achievements
Rank 1
answered on 18 Feb 2011, 05:25 PM
Hi Princy

I am having similar problem. I have a tree in a RadCombox and that tree is loading on demand. when I click on a node, combobox is closing. For loading the tree I am using code-behind. How can I make ComboBox remain open untill I make my selction ? That StopPropagation  is not working for me.

Please help,
Smiely
Tags
ComboBox
Asked by
A W
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
A W
Top achievements
Rank 1
Smiely
Top achievements
Rank 1
Share this question
or