ComboBox list width doesn't match column width in GridPanel

  1. #1

    ComboBox width doesn't match column width in GridPanel

    How do I make the width of the ComboBox be the same as the width of the column?

    Here is what's happening:
    Click image for larger version. 

Name:	combobox.png 
Views:	231 
Size:	7.4 KB 
ID:	5521

    Here is my code:
    columnModel.Add(Html.X().ComponentColumn()
        .Text("State").DataIndex("STATE")
        .Editor(true).OverOnly(true).PinEvents("expand").UnpinEvents("collapse")
        .Width(50)
        .Component(Html.X().ComboBox()
            .Width(50)
            .Editable(false)
            .AllowBlank(false)
            .ForceSelection(true)
            .Items(states => { 
                ... 
            })
    )));
    A partial solution is adding .MatchFieldWidth(false), which changes the list size, but not the field size (i.e. I still don't see the drop-down arrow for selection):
    Click image for larger version. 

Name:	combobox2.png 
Views:	195 
Size:	8.7 KB 
ID:	5523
    But this is still not what I want.
    Last edited by KBorkiewicz; Jan 31, 2013 at 3:02 PM.
  2. #2
    Default MinWidth for drop down list is 70
    You can set own MinWidth in ListConfig
  3. #3
    The width of the list is not 70. It seems to be about 120.
    And the problem isn't just with the list, but also the field.

    I added .ListConfig(Html.X().BoundList().MinWidth(50)) and it did not change anything.

    columnModel.Add(Html.X().ComponentColumn()
        .Text("State").DataIndex("STATE")
        .Editor(true).OverOnly(true).PinEvents("expand").UnpinEvents("collapse")
        .Width(50)
        .Component(Html.X().ComboBox()
            .ListConfig(Html.X().BoundList().MinWidth(50))
            .Width(50)
            .Editable(false)
            .AllowBlank(false)
            .ForceSelection(true)
            .Items(states => { 
                ... 
            })
    )));
    Last edited by KBorkiewicz; Jan 31, 2013 at 5:13 PM.

Similar Threads

  1. Replies: 1
    Last Post: Jun 04, 2012, 3:48 PM
  2. [CLOSED] Grid Panel : Column width (Auto width)
    By legaldiscovery in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 24, 2011, 8:31 PM
  3. Combobox autoSize to List width
    By johnsoftinfos in forum 1.x Help
    Replies: 4
    Last Post: Dec 10, 2010, 8:45 AM
  4. Replies: 6
    Last Post: Jun 11, 2010, 12:47 PM
  5. [CLOSED] ComboBox Item List not displaying full Width
    By bfolger in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 24, 2009, 10:12 PM

Tags for this Thread

Posting Permissions