When I expand the row height, the combobox fills the row as in the attached picture, how can I force the combo box to remain the same size docked to the top?
I have tried the following
customCombo = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
customCombo.Appearance.ImageVAlign = VAlign.Middle;
customCombo.AlwaysInEditMode = true;
customCombo.Dock = DockStyle.Top;
ultraGrid1.DisplayLayout.Bands[1].Columns["Custom RAG"].EditorControl = this.customCombo;
ultraGrid1.DisplayLayout.Bands[1].Columns["Custom RAG"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownValidate;
ultraGrid1.DisplayLayout.Bands[1].Columns["Custom RAG"].AutoSizeMode = ColumnAutoSizeMode.None;
ultraGrid1.DisplayLayout.Bands[1].Columns["Custom RAG"].CellMultiLine = DefaultableBoolean.False;
I have tried various Dock and anchor options, but no luck
Any suggestions
This is actually one of the simplest CreationFilters you can do. :)
public class MyCreationFilter : IUIElementCreationFilter { #region IUIElementCreationFilter Members void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { if (parent is DropDownButtonUIElement) { parent.Rect = new Rectangle( parent.Rect.X, parent.Rect.Y, parent.Rect.Width, parent.Rect.Width ); } } bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { return false; } #endregion }
Notice that I used the Width of the element for the height and the width.
Thank you.
Your example just resized the drop-down-button.
I mad some changes and now also the drop-down itself is adjusted to a "normal" row height of 18 and wont start below a higher row.
public class GridCreationFilter : IUIElementCreationFilter { #region IUIElementCreationFilter Members void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { // if the parent element is not a cell element return if (!(parent is CellUIElement)) return; // get the associated cell UltraGridCell cell = parent.GetContext(typeof(UltraGridCell)) as UltraGridCell; // Return if the column isn't the style we want to adjust if (cell == null || cell.Column.Style != ColumnStyle.DropDown) return; // loop over the child elements and adjust their height foreach (UIElement child in parent.ChildElements) { Rectangle childRect = child.Rect; childRect.Height = 18; child.Rect = childRect; } } bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { return false; } #endregion }