Hide empty dropdown

3 posts, 1 answers
  1. John Hadjioannou
    John Hadjioannou avatar
    30 posts
    Member since:
    Dec 2005

    Posted 27 Jun 2010 Link to this post

    I would like to hide the dropdown when it is empty - how could that be achieved?

    Ideally, I would like to reduce it's size to match the contents if there is empty space at the bottom - but that may be too difficult.

    Thanks
    John
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Jun 2010 Link to this post

    Hi,

    You can cancel the 'OnClientDropDownOpening' by using the code "args.set_cancel(true)" if there are no items in the RadComboBoxItems collection. You can check the number of items from client-side. The following documentation will help you in achieving this:
    Client-Side Basics
    RadComboBox object

    Also checkout the following forum which discussed about setting the dropdownwidth according to items.
    Auto Width

    KB Article - Set the Height of RadComboBox based on number of items


    -Shinu.
  3. John Hadjioannou
    John Hadjioannou avatar
    30 posts
    Member since:
    Dec 2005

    Posted 28 Jun 2010 Link to this post

    Thank you

    John
Back to Top