Resize the height of UltraDropdown in Infragistics Dynamically

1.2k Views Asked by At

In one of my winforms application i need to increase the height of the UltraDropdown dynamically according to the values that is being bind in the dropdown. In simple words there should be no scroll bar to view the last value of the dropdown when clicked.

//Code:

'Configure column

  UltraGridColumn.CellActivation = If(Me.WController.SController.SelectedStatus.IsSelectable And Me.WController.SelectedW.HasUpdateAccess, Activation.AllowEdit, Activation.ActivateOnly)
                UltraGridColumn.CellAppearance.BackColor = Color.LightYellow
                UltraGridColumn.CellAppearance.FontData.Bold = If(Me.WController.SelectedW.HasUpdateAccess, DefaultableBoolean.True, DefaultableBoolean.False)
                UltraGridColumn.CellAppearance.FontData.Italic = If(Not Me.WController.SelectedW.HasUpdateAccess, DefaultableBoolean.True, DefaultableBoolean.False)
                UltraGridColumn.ExcludeFromColumnChooser = ExcludeFromColumnChooser.True
                UltraGridColumn.Header.Caption = "Transaction Status"
                UltraGridColumn.Header.ToolTipText = "Transaction status."
                UltraGridColumn.Hidden = False
                UltraGridColumn.Style = ColumnStyle.DropDownList
                UltraGridColumn.ValueList = Me.WController.SController.StatusesValueList()

In the above code i'm configuring a column as dropdown in a infragistics grid and bind some values in the dropdown. So when the dropdown is clicked it shows some 20 values which has a scroll bar.

Now, instead of the scroll bar i need the height of the dropdown to be increased according to the number of values binding in the dropdown.

Any help?

Note: Used Infragistics version is 12.0

1

There are 1 best solutions below

0
On

There are different approaches to solve this task. Looking at your code, I see that you are using ValueList into your scenario, so maybe one possible solution could be:

((Infragistics.Win.ValueList)(ultraGrid1.DisplayLayout.Bands[0].Columns["C"].ValueList)).MaxDropDownItems = 2;

Let me know if you have any questions.