I am using an UltraComboEditor with a set of ValueListItems where I have assigned an image to each Item. The image is a png of a 16x16 icon stylye image. I have set the combo value list with DisplayStyle.DisplayTextAndPicture. This will display the images and text correctly although the images are scaled down to the height of the text.
With ValueList.ScaleItemImage = ScaleImage.Never to force the item height to be scaled to accomodate the image, the DropDownBox shows a region of white space after the drop down items. The actual height of the DropDownBox appears normal but with scroll bars allowing the user to scroll past the end of the list. Selecting in this area seems to somewhat randomly select one of the items in the list
Are there any settings or methods to force the DropDownBox to recalculate the list size after populating items?
Hello Mike,
I tried setting the ItemHeight and it also corrects the scroll box sizing issue.
In our case, the earlier solution adding a null image provides greater flexibility for various application styling for fonts, etc. For the null item, I simply added the line
vli.Appearance.Image = new Bitmap(16, 16);
Thanks,
Wendy
Hi Wendy,
It occurred to me that there is also another way to solve this problem which is even easier. So if you don't want to overhead of creating an extra image, you could do this:
this.ultraComboEditor1.ValueList.ItemHeight = 16;
Hi Mike
I added the blank image and it's corrected the scroll issue.
Ah, that explains it. Once you add an item that has no image, the Combo will behave differently, because it now has variable-height items. Having items with different heights make it much more difficult (and expensive in terms of performance) for the control to calculate the total height needed.
What I would do is create a blank 16x16 image and assign it to the null item. That way all the items will have the same size image and it will correct the scrolling issue and make the control more efficient.
Thanks for the sample. It have modified it several times to narrow down the source of the odd behaviour. The sample as given does not show the drowdown sizing issue. If you add a null item with no image to allow the user to select null. The odd sizing is then shown.
this.ultraComboEditor1.Items.Add(null, "");
My combos are used with databinding to properties. I use the null item to allow the user to null the property.
thanks