Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
UltraComboEditor - overriding list item height
posted

Hi there,

I've got an UltraComboEditor in which I am displaying a custom image for each item.
Each image is 24x24 pixels.
I can make it display nicely for the selected item by setting AutoSize = false; and then increasing the control height accordingly.
However, when view the items in the drop down list, the images are shrunk down and look poor.
If I increase the font size, the image looks good, but the text is way too big! 

Is there any way that I can override the height of each list item such that the image displays nicely, rather than being based on the font size?

Cheers,

James

  • 469350
    Verified Answer
    Offline posted

    Hi James,

    This should do it:

    this.ultraComboEditor1.ValueList.ScaleItemImage = ScaleImage.Never;

    • 400
      posted in reply to Mike Saltzman

      Hi Mike,

      Thanks for the swift reply!!

      That's resolved it, but created another issue...

      With ScaleImage.Never, the drop down list height it still being calculated based on the font size.
      This means that I now only see 3 items in the list instead of 8!

      Is there an associated property I need to play with to get this looking better too?

      Cheers,

      James 

      • 18495
        posted in reply to James

        Hello James,

        When I tried Mike's suggestion myself, the dropdown height increased to show the default 8 items.  Which version of NetAdvantage are you using?  It's possible the issue you described was resolved in a later version.

        • 400
          posted in reply to James

          I've cracked it...

          I actually had the first item in the list without an image.
          I'm guessing that drop down height is calculated as MaxDropDownItems (8) * First Item Height

          Setting an image on the first item fixed everything! 

          Many thanks,

          James

          • 400
            posted in reply to James

            Following up... increasing MaxDropDownItems to 18 instead of 8 let's me see the 8 I want!!

            I don't mind going down this route, but would prefer a more intuitive approach! :O)