Hi.
I have an UltraCombo that is assigned to a grid cell EditorControl. Everything works as planned, except for one thing: The UltraCombo grid column does not auto size to the drop down.
I have tried setting the relevant AutoSize on the column and AutoFitStyle on the control without luck.
What am I missing here?
Best regards,
Goran
hedge58 said:As I understand it, the UltraDropDown does not support Suggest functionality when used as EditorControl. So thats why I use the UltraCombo.
Okay, that's correct.
hedge58 said:Now if I only could find a place to read the width of the drop down button, I would be all set...
The width of the button is not expose via any property, but I'm pretty sure it's a constant, so you could just hard-code a value.
Or, you could try to get it from the UIElement. This will only work if the button is visible on the screen, but that should not be a problem - I can't think of a case where BeforeCellListDropDown could fire when the button is not visible.
So you can get the ActiveCell in the grid and call GetUIElement on it, then use GetDescendant on that to get the button element and use it's Rect to determine the width.
As I understand it, the UltraDropDown does not support Suggest functionality when used as EditorControl. So thats why I use the UltraCombo.
Got it to work! Now if I only could find a place to read the width of the drop down button, I would be all set... ;-)
/G
Private Sub productTypesGroupsGrid_BeforeCellListDropDown(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelableCellEventArgs) Handles productTypesGroupsGrid.BeforeCellListDropDown Dim tmpDD As Ultra Dim btnWidth As Integer = 20 tmpDD = CType(e.Cell.EditorControlResolved, UltraCombo) If tmpDD IsNot Nothing Then tmpDD.DisplayLayout.Bands(0).Columns("Name").Width = e.Cell.Column.CellSizeResolved.Width - btnWidth End If End Sub
Okay... May I ask why you are using an UltraCombo for this? I can't get this to work with an UltraCombo, but UltraCombo is actually not the most efficient way to provide a dropdown list in a grid cell.
If you use UltraDropDown and assign it to the column's ValueList, instead, it's very easy:
this.ultraDropDown1.DropDownWidth = 0;this.ultraDropDown1.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
Yes, exactly. I need for the drop down to auto size to the container cell, and I need the drop down column to auto sixe to the drop down width.
Trying with the BeforeCellListDropDown now, will report on result.