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

RadCombo with Checkbox and custom Javascript

2 Answers 92 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gotcha
Top achievements
Rank 1
Gotcha asked on 15 Jan 2012, 01:22 AM
Hi ,

I need some custom changes to be done on the current  RadCombo features:
1. Assuming I have a RadCombo with checkboxes and the list of items are
[ ] No Preferences
[ ] Product 1
[ ] Product 2
[ ] Product 3

When I check No Preferences (Index 0) , All already selected Items should be unchecked... Conversely, If I check One of the item from Product 1 - 3, It should uncheck No Preference.

2. Also, When I click on the Description, it should check and uncheck the checkbox...

3. The CheckedItemsText when It is "Display All In Input"... I need to show the whole String as long as it would fit within the Width of the Combo and if it exceeds certain length, I would like to truncate the string and append "..." at the end

Can anyone point me to where I can find information on how to access the checked elements, the CheckedItemText property within the RadCOmbo to achieve such a requirement using ClientSide Javascript?

Thanks

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Jan 2012, 09:05 AM
Hello Gotcha,

you can access the checked items with the client side as below.
Client side:
combo.get_checkedItems()
combo.get_checkedIndices()

Thanks,
Princy.
0
Accepted
Kalina
Telerik team
answered on 17 Jan 2012, 01:53 PM
Hi Gotcha,

I am afraid that the CheckBoxes feature does not support the scenario that you want to implement.
However you can try implementing RadComboBox Templates and add a custom JavaScript logic to be executed upon a CheckBox "check".
(Please note that RadComboBox Templates are not supported if you use Load on Demand via WebService.)

You can take a look at this online demo where a similar scenario is implemented.
Additionally you might find useful some of these Code Library projects.

Regards,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ComboBox
Asked by
Gotcha
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kalina
Telerik team
Share this question
or