Home > Enterprise >  Set the height of the ListControl of a DevExpress ComboBox
Set the height of the ListControl of a DevExpress ComboBox

Time:10-04

I have a DevExpress ComboboxEdit which can have a different number of items at any given time.

I have the list count set to 8 and it works fine.
If the list is actually less than 8 then it shows the extra blank lines.

How can I shrink the height based on the number of items in the list if less than 8?

CodePudding user response:

You can iterate the combobox with foreach and remove when the value is null

CodePudding user response:

Eureka! Knew it was easy.

List<String> _reasons = new List<String>() {"a","b"};
if (_reasons.Count < Reason.Properties.DropDownRows)
    Reason.Properties.DropDownRows = _reasons.Count;
  • Related