Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Ultracombo column, dropdown grid to fit the celll width

Ultracombo column, dropdown grid to fit the celll width

New Discussion
leo
leo asked on Oct 5, 2017 5:40 PM

Hello

This might be simple, but I can’t seem to find the answer, I have an ultracombo as the editor of one of the cells of my grid, the values of the ultra combo is a grid itself (bound to a list of objects). The ultracombo width on the cell matches the cell width, but the grid that dropdowns with it does not. It seems that the width of the grid inside the cell seems to match the width of the originating ultracombo.   I’ve already tried ultracombo.DisplayLayout.AutoFitStyle = ResizeAllColumns. I also set the ultra combo DropDownWidth = 0.

See the control setup in the pic attached (the actual ultracombo on top on the final form will not be visible)

Thank you

Sign In to post a reply

Replies

  • 0
    Sahaja Kokkalagadda
    Sahaja Kokkalagadda answered on Sep 29, 2017 6:43 PM

    Hello,

    I was able to observe the UltraCombo dropdown width mismatch behavior that you mentioned. You can work around this by using an UltraComboEditor instead of an UltraCombo. I have tested this behavior with an UltraComboEditor and when I open the dropdown the width of the Grid matches with the Cell width.

    Please try the above suggestion and let me know if I may be of further assistance.

    Sincerely,
    Sahaja Kokkalagadda
    Associate Software Developer

    • 0
      leo
      leo answered on Sep 29, 2017 8:04 PM

      We need it to be an UltraCombo because we need to display the value selection as a multicolumn grid. Isn't there a way to make it work with the UltraCombo control?

      • 0
        Sahaja Kokkalagadda
        Sahaja Kokkalagadda answered on Oct 2, 2017 7:45 PM

        UltraDropDown is an alternative control that you can use in this scenario. This will show value selection as a multicolumn Grid and also addresses the dropdown width mismatch issue. UltraDropDown can be assigned to the ValueList property of the Column.

        Please let me know if I may be of further assistance.

        Sincerely,Sahaja KokkalagaddaAssociate Software Developer

      • 0
        leo
        leo answered on Oct 2, 2017 8:28 PM

        Although the UltraDropDown control does seem to behave better with respect to resizing itself within a grid cell, it does not seem to have the same functionality that the UltraCombo offers. For one, If I start typing inside the control, it seems to search only as a "Starts with" and there does not seem to be a way to specify a "Contains" search type (as in the UltraCombo AutoComplete and AutoSuggestFilterMode properties). In my scenario we display our records as Code – Description, like:

        1001 – Red article

        1002 – Blue article 

        1003 – Violet cube

        So if I begin typing "art" I expect the list to show only  the "1001 – Red article" and "1002 – Blue article" entries. In this example the UltraDropdown just does not finds anything.

        Which brings me to my second point: The ultradropdown doesn't seem to filter the way the UltraCombo does, it just seems to position the user at an index inside the list

        Until now, only the UltraCombo control does what I want, the only issue is the resizing. Is there a a workaround so that the UltraCombo resizes itself in the same way that the UltraDropdown does?

      • 0
        Mike Saltzman
        Mike Saltzman answered on Oct 3, 2017 2:17 PM

        UltraDropDown and UltraCombo derive from the same base class, so they support nearly identical functionality. 

        To do "StartsWith" Filtering when the user types in the cell, you need to set properties on the grid column (not the UltraCombo/UltraDropDown)

        band.Columns["My Column"].AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend;
        band.Columns["My Column"].AutoSuggestFilterMode = AutoSuggestFilterMode.StartsWith;

        The only thing you can do with UltraCombo that you can't do with UltraDropDown are: 

        1) DataFiltering (which is not the same as AutoSuggest like you described here)

        2) Editor Buttons (which you probably don't need)

        3) CheckBoxSettings (to check/select multiple items on the list at once). 

      • 0
        leo
        leo answered on Oct 3, 2017 10:03 PM

        If it does not filter the same way the ultra combo does, that is, only showing the elements that comply to the search criteria instead of just focusing on an index inside the list, then the UltraDropdown is just not an option for us. Can you please tell me if there is a workaround I can use on the UltraCombo for it to have the correct resize behavior? 

      • 0
        Mike Saltzman
        Mike Saltzman answered on Oct 4, 2017 2:27 PM

        Hi, 

        The only workaround I can think of is that you could handle the grid's BeforeCellListDropDown event and set the DropDownWidth on the UltraCombo to exactly the width of the column before it drops down. 

        But I don't understand why you are having a problem with the "filtering". I'm not even sure what you mean by "filtering" in this context. But as I said, the UltraCombo and UltraDropDown derive from the same base class are have nearly identical functionality. So unless you are using editor buttons or something like that, there's no reason why you can't use UltraDropDown. I'm guessing that by "filtering" you are referring to the AutoSuggest functionality, and I already explained how to get the same behavior. You have to set properties on the grid column instead of on the UltraCombo, that's all. 

      • 0
        leo
        leo answered on Oct 4, 2017 8:19 PM

        I’m attaching sample code so you can see what my problem is. Basically I have two columns: Detail1 and Detail2. Both use the same underlying datasource.

        Detail1 uses an UltraCombo control while Detail2 uses an UltraDropdown

        I don’t know what I’m doing wrong but I cannot make the UltraDopdown on Detail2 to work the way the ultraCombo on Detail1 does

        Main differences:

        – When you start typing on Detail1 the dropdown shows the grid immediately (which I like)

        – Upon typing on Detail1, the combo starts showing only the entries that match what is being typed. Detail2 shows always all the items in the dropdown, it just seems to change the index of the item selected (see ultracombo suggest.png and ultradropdown suggest.png)

        – Even though both columns are set to  use AutoCompleteMode.SuggestAppend and AutoSuggestFilterMode.Contains, only the values on Detail1 are being searched as “contains” the ones on Detail2 seem to only work as StartsWith (I really need it to work as Contains)

        The only thing the UltraDropdown is doing correctly is the fact that it is resizing the grid according to the size of the cell, which is the one thing I need in the UltraCombo

        Can you please tell me what I’m doing wrong?

        I’m using Infragistics version 17.1

        Thanks

        Thanks

        Attachments:
      • 0
        Mike Saltzman
        Mike Saltzman answered on Oct 5, 2017 5:05 PM

        Hi, 

        My apologies. While working with your sample, it appears that UltraDropDown does not support AutoSuggest. I'm not sure why that is. It works with UltraCombo and with a ValueList, but for some reason, UltraDropdown just doesn't support it. 

        So going back to your original question about the dropdown width, when I run your sample, the width of the dropdown matches the width of the cell in every case. I tried making the column width larger or smaller, but it seems to work whatever I do. So I'm now confused about what the original issue is. In fact, it's even the same in the screenshots you included here.

        Under what circumstances does the width of the dropdown not match the width of the column?

      • 0
        Mike Saltzman
        Mike Saltzman answered on Oct 5, 2017 5:40 PM

        Okay, I think I see the issue now. The problem here is not with the size of the DropDown window, it's the size of the columns within the dropdown. You are setting AutoFitStyle and the dropdown appears to be using the width of the UltraCombo control on the form instead of the width of the dropdown when AutoFittting the columns. So I think that's a bug in the control that we will need to look into.

        For a workaround, you could turn off AutoFitColumns and then handle AfterCellListDropDown and then explicitly set the width of each column. But it would be tricky, since you would have to account for the scrollbars. 

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
leo
Favorites
0
Replies
10
Created On
Oct 05, 2017
Last Post
8 years, 4 months ago

Suggested Discussions

Tags

Created by

leo

Created on

Oct 5, 2017 5:40 PM

Last activity on

Feb 19, 2026 4:05 PM