Skip to content

UltraCombo column width

New Discussion
mihail
mihail asked on Jul 12, 2016 3:04 PM

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

Sign In to post a reply

Replies

  • 0
    mihail
    mihail answered on Nov 2, 2008 12:32 PM

     Got rid of the scrollbar by setting Scrollbars.None. Question is why I am getting it when the length doesn't change?

    Thanks.

  • 0
    Mike Saltzman
    Mike Saltzman answered on Nov 3, 2008 4:15 PM

    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. 

    • 0
      mihail
      mihail answered on Nov 4, 2008 7:22 PM

       Thanks Milke, it worked as expected.

    • 0
      mphoenix
      mphoenix answered on Sep 16, 2013 9:12 AM

      That's it Mike. It works for me too. Thanks a lot…

    • 0
      Paul Scannell
      Paul Scannell answered on Jul 11, 2016 2:31 PM

      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 = 800
      End 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?

      Thanks,

      Paul

      • 0
        Mike Saltzman
        Mike Saltzman answered on Jul 12, 2016 3:04 PM

        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.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
mihail
Favorites
0
Replies
6
Created On
Jul 12, 2016
Last Post
9 years, 7 months ago

Suggested Discussions

Tags

Created by

Created on

Jul 12, 2016 3:04 PM

Last activity on

Feb 25, 2026 9:55 AM