Hi:
I have an UltraCombo with 2 columns - one hidden (key) the other one visible (description). The width of the second column is equal with the combo box width/dropdown widht and that is what I want. At some point I am reseting the dropdown width to be the combo width, the visible column width shrinks to the length of the each string/description when droping doen the list. I am trying to set it to be the combo's width in before drop down, it woks but now I am getting a horizontal scroll bar with it. It is the right widht, the one dipalyed before reseting the dropdownwidht to be the combo's width, don't understand why I get the scroll bar now. Is there a way to deal with this?
Thanks,
Mihail
Hi Paul,
I don't see anything wrong with this code. If you are saying that column 1 is NOT showing up with a Width of 800, then something else in your application must be changing the width after this code is executed. Or perhaps this code is not getting executed at all.
What event is this code in? The InitializeLayout event would be the best place to set the column width.
If you are not explicitly setting the width somewhere else in your code, check to see if you are calling PerformAutoSize or combo.DisplayLayout.LoadXXX to load a layout.
Mike,
I'm working with customizing the ultra combo box for the first time. My application's DLL has a wrapper function set that deals with the underlying Infragistics controls.
What I need to do is set the dropdown portion of the control to have a total width of 800. Column 0 = 10 (doesn't matter because it is hidden) and Column 1 = 790.
The problem I am having is determining how the code should look to set the width. I've tried this but it doesn't do a thing:
With cmbLookupAward .DataSource = Nothing .DataSource = setGridData ( SQLStatement ) ' setComboBoxData .DisplayLayout.UseFixedHeaders = False '.DisplayLayout.Bands(0).ColHeadersVisible = False '.DisplayLayout.Bands(0).Columns(0).Hidden = True .DisplayLayout.Bands(0).Columns(0).Width = 10 .DisplayLayout.Bands(0).Columns(1).Width = 800End With
So I'm guessing there is a global drowdown width property or something like that that I'm missing?
Could you provide the actual code to do it? For example, What object level contains the DropDownWidth property?
Paul
That's it Mike. It works for me too. Thanks a lot...
Thanks Milke, it worked as expected.
I'm having a little trouble following your description.If you are getting a scrollbar, then the width of the Column must be greater than the available area of the dropdown. Setting the Width of the column to the DropDownWidth might not work the way you want it, because the dropdown may have other things to account for, such as borders. If you are setting the DropDownWidth to a literal width, then maybe what you need to do is set AutoFitStyle on the Combo so that the columns are automatically sized to fit the available width.