I'm implementing an embedded popup, and I want to resize it to the same width as the last column.
Hi,
I just wanted to know if you were able to solve your issue based on Mike suggestions or you still need help? Just let me know.
The DropDown for the DropDownEditorButton takes it's size from either the PreferredDropDownSize property (if you have turned on the sizing handle) or else the size of the control on the dropdown (is user resizing of the dropdown is not turned on).
So what you can do is handle the BeforeDropDown event on the button or the editor control and set the size of the dropdown to whatever you want.
void dropDownEditorButton_BeforeDropDown(object sender, BeforeEditorButtonDropDownEventArgs e) { UltraGridCell cell = e.Context as UltraGridCell; if (cell != null) { DropDownEditorButton dropDownEditorButton = e.Button as DropDownEditorButton; if (dropDownEditorButton != null) { Size dropdownSize = new Size( cell.Column.CellSizeResolved.Width, dropDownEditorButton.PreferredDropDownSize.Height ); // You only need one of these two lines, not both. dropDownEditorButton.PreferredDropDownSize = dropdownSize; dropDownEditorButton.Control.Size = dropdownSize; } } }
I'm using a custom control not valuelist.
I just wanted to know if you were able to solve your issue based on our suggestions or you still need help? Just let me know.
Thank you.
Hello,
If you are set a ValueList for ValueList property of the column, then the drop down will be with the same width like the owning column, by default.
Please let me know if you have any further questions.