RadCombo with Checkbox and custom Javascript

3 posts, 1 answers
  1. Gotcha
    Gotcha avatar
    64 posts
    Member since:
    Sep 2009

    Posted 14 Jan 2012 Link to this post

    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. Princy
    Princy avatar
    17237 posts
    Member since:
    Mar 2007

    Posted 16 Jan 2012 Link to this post

    Hello Gotcha,

    you can access the checked items with the client side as below.
    Client side:

    combo.get_checkedItems()
    combo.get_checkedIndices()

    Thanks,
    Princy.

  3. Answer
    Kalina
    Admin
    Kalina avatar
    918 posts
    Member since:
    Dec 2013

    Posted 17 Jan 2012 Link to this post

    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

Back to Top