We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How To Fit Size of PopupControlContainer (CellType ComboBox)

Thread ID:





34453 Sep 9,2005 09:54 AM UTC Oct 11,2005 07:56 AM UTC WinForms 16
Tags: GridControl
Michael Mann
Asked On September 9, 2005 09:54 AM UTC

Hi, I have a cell (type ComboBox) and want to control the size of the displayed popuphost. When I set the maximum size, the scroll bar disappears. How can I set the width of the popup box to the width of the cell and displaying the scroll bar. Additionally, is it possible to set a tooltip text for the items in the comboBox list? thanks Michael

Administrator [Syncfusion]
Replied On September 9, 2005 04:09 PM UTC

You control the width of the dropdown using the CurrentCellShowingDropDown event. There you set the e.Size parameter. This includes both a width and a height. But please note the you set will be ignored. The height of the dropdown is determined through the DropDownRows property as discussed in this KB. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=288 There is no built-in support for tips over the dropped list. You would have to code this your self. You can get ListBoxPart as in th eKB code, and then try attaching a Windows Forms ToolTip to it dynamcailly in CurrentCellShowingDropDown. Not sure whether this will work or not.

Michael Mann
Replied On September 12, 2005 03:03 PM UTC

Hi, in my statement above I mentioned that the vertical scrollbar disappears when I set the size of the popup container. How can I prevent this? Michael

Michael Mann
Replied On September 13, 2005 02:58 PM UTC

Can you reproduce this behaviour?

Michael Mann
Replied On September 14, 2005 07:46 AM UTC

Any updates? Any hints?

Administrator [Syncfusion]
Replied On September 14, 2005 01:19 PM UTC

Hi Michael, I tried to reproduce the issue of yours, but couldn''t make it. Can you send me a sample reproducing the behaviour you are seeing or can you reproduce in this attached sample? boundcolumns.zip Regards, Leo.

Michael Mann
Replied On September 15, 2005 09:38 AM UTC

hi, I used your example and modified it. If the text is longer than the width of the popup box, then the scroll bar disappears. In your example, the width even isn''t restricted to the width of the column and the box is greater than the width of the column. Can you check this behaviour? Can you agree to that? Michael scroll_problem_5465.zip

Michael Mann
Replied On September 21, 2005 07:14 AM UTC

Any updates?

Administrator [Syncfusion]
Replied On September 22, 2005 02:29 AM UTC

Michael, would a sample be ok if it uses the GridListControl dropdown cell type? The GridDropDownGridListControlPart has a AllowModifySetBoundsCore property that would help with manually sizing the control. But you would then need to provide a wrapper for the StringCollection class that is an IList and returns each string as part of an object with one property (the string). We can provide a sample for such a wrapper collection if that meets your needs. With GridListControl you can also have support for tooltips. The GridComboBoxCellRenderer uses only a regular listbox. The regular listbox does not have support for horizontal scrolling and also no support for tooltips. Also, you would need to derived the ListBoxPart in order to turn off the automatic sizing of the control. Stefan

Michael Mann
Replied On September 22, 2005 07:00 AM UTC

Hi, thanks for your reply. Temporarily I''ll forget about the tooltip, because that''s not that important. But what''s more is the fact, that my vertical scrollbar disappears in the sample I uploaded in my last entry. Maybe I didn''t make my point clear enough: I did size the popupContainer, but if an entry (a string) is longer than the width of the container, the vertical scrollbar disappears. My question is: Am I doing something wrong, and can you agree to that and is there any workaround for this? Thanks in advance Michael

Michael Mann
Replied On September 22, 2005 08:42 AM UTC

hi, please find the attached example that shows the different popup sizes with the lost vertical scrollbar. Michael popup_9799.zip

Administrator [Syncfusion]
Replied On September 22, 2005 05:05 PM UTC

Micahel, See a modified Form1.cs here: Form1.zip Couple points: - Setting MaxSize on the PopupHost does not work. It has a GridDropDownContainer embedded that is just a panel. Only inside that panel the listbox is hosted. The control that is hosted (the list control) needs to implement the scroll logic. - The ListBox used by ComboBoxCellRenderer has a hard-coded SetBoundsCore override and is therefore very resistant to any sizing efforts. You would need provide your own ListBoxPart implementation to avoid that. I also provided a GridListControl solution as discussed earlier but let me know if you see more issues with that. Stefan >hi, > >please find the attached example that shows the different popup sizes with the lost vertical scrollbar. > >Michael > >popup_9799.zip > >

Michael Mann
Replied On October 5, 2005 08:00 AM UTC

Hi, I don''t really know what you wanted to show me with that example and how I can force the vertical scrollbar to appear. So please give me more advice on that. Michael

Administrator [Syncfusion]
Replied On October 5, 2005 10:06 AM UTC

Here is your sample back modified to use a GridListCOntrol dropdown. http://www.syncfusion.com/Support/user/uploads/MyWork_d04d4266.zip With the combobox dropdown, the minimum width of teh combobox is set so all items are fully visible. This means when you size its container smaller, the combobox still maintains its minimum width which puts its scrollbars outside of teh client area of the container. I do not know of a way to work around this without deriving your own dropdown cell. But with a a GridListControl dropdown, you have more chances to modify its behavior. In the sample, 2 events are used to control the size of dropdown so that the vertical scrollbar is visible.

Michael Mann
Replied On October 10, 2005 09:05 AM UTC

Thanks, I see this working. But isn''t there a way to have the same behaviour for a GridComboBoxCellRenderer? My celltype is a comboBox, and switching to a different cell type is a big deal by now.

Administrator [Syncfusion]
Replied On October 10, 2005 10:40 AM UTC

I do not know of a way. Is it the number of comboboxes that you have that is teh problem? If you have used DataSource/DisplayMember/ValueMember properties, on the surface, changing from a ComboBox cell to a GridListControl cell amounts to changing CellType="ComboBox" to CellType="GridListControl".

Michael Mann
Replied On October 11, 2005 07:56 AM UTC

Sure, that''s not the problem. The problem is that we use a static method that evaluates a specific type and then sets all properties for a style object. This is used by many apps, and we dont have the time now, to get through all the affected apps. thanks anyway


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon