Hi All,
Is it possible to add multiple columns to the dropdown of an UltraComboEditor? I know that it can be done for an UltraCombo object by adding a band to its DisplayLayout.BandSerializer collection but I can't see any obvious way of doing this for an UltraComboEditor.
Thanks in advance,
Denis
WinComboEditor can only display a single column at a time, as does a ValueList. You will need to use either WinDropDown or WinCombo control instead.
The following article from our online Knowledge Base may prove helpful, if you're planning on putting your WinComboEditor (or other drop-down interface) in WinGrid:HOWTO: What is the best way to place a DropDown list in a grid cell?
Thanks Vince,
One other thing you may be able to help me with. I don't want to display the dropdown button on the WinCombo. When using a WinComboEditor I can just set the DropDownButtonDisplayStyle to ButtonDisplayStyle.Never, is there someway I can acheive this for a WinCombo?
Denis.
Hi Mike,
I actually am using the dropdown in a grid however what I need to do is hide the dropdown button and then add my own custom button.
Essentially what I am trying to design is a type of walker control, i.e. an editor which behaves like a dropdown with AutoComplete mode set to 'Suggest' when text is being entered in the text area, then if the editors button is clicked it will open a seperate custom window. The only possible way I can think of doing this is to somehow override the dropdown buttons Click event but that probably isn't possible??
Hi Denis,
Why not use an UltraComboEditor in this case, then? If you are hiding the dropdown button and you are going to show your own dropdown, anyway, then you don't really need the UltraCombo's ability to display multiple columns. UltraComboEditor has AutoSuggest capability.
I don't actually want to hide the dropdown at all, just the dropdown button. When the user types text into the edit portion I want the UltraCombo multi-column to drop down as normal, however when the user presses the dropdown button I want a different custom built form to display and not the dropdown.
I've had no luck in achieving this so far so I think I'm just gonna have to use a standard TextBox as the editor with a button added to it and build the multicolumn dropdown myself.
The following code sample demonstrates how to solve this problem for the UltraCombo or UltraComboEditor control using the IUIElementCreationFilter interface:
using Infragistics.Win;
#region NoDropDownButtonCreationFilter/// <summary>/// Prevents the dropdown button from appearing for an EditorWithComboUIElement/// </summary>public class NoDropDownButtonCreationFilter : IUIElementCreationFilter{ #region IUIElementCreationFilter Members
void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { EditorWithComboUIElement editorElement = parent as EditorWithComboUIElement;
if ( editorElement != null ) { DropDownButtonUIElement dropdownButtonElement = editorElement.GetDescendant( typeof(DropDownButtonUIElement) ) as DropDownButtonUIElement;
EditorWithTextUIElement textElement = editorElement.GetDescendant( typeof(EditorWithTextUIElement) ) as EditorWithTextUIElement;
if ( dropdownButtonElement != null && editorElement.ChildElements.Contains(dropdownButtonElement) ) { editorElement.ChildElements.Remove( dropdownButtonElement );
if ( textElement != null ) textElement.Rect = editorElement.RectInsideBorders; } } }
bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { return false; }
#endregion}#endregion NoDropDownButtonCreationFilter
I have created this class and set the CreationFilter property of my UltraCombo object to a new instance of this class, however when I attempt to embed the control in a grid I get the following runtime error:
"Unable to cast object of type Infragistics.Win.UltraWinGrid.DataAreaUIElement to type Infragistics.Win.EditorWithComboUIElement"
Do I need to set some property of the grid to enable this to work?
You might just have to assign an instance of that class to the grid's CreationFilter property, but I haven't confirmed that no other modifications are necessary.