Home Forums WinForms controls Xceed Grid for WinForms Change ComboBoxEditor width on Column Width change. Reply To: Change ComboBoxEditor width on Column Width change.

User (Old forums)
Post count: 23064

This does not work because you are doing it on the template, which is taken into consideration only when first loading the grid. After that, you need to do it on the actual control itself that gets activated when the cell falls into edit mode.

Therefore you need to subscribe to the SettingControlAppearance, and use e.Control in the event handler to set the width of the Dropdown. You need to cast the e.Control to a WinComboBox for this to work.

e.g. :

private void CellEditorManager_SettingControlAppearance(object sender, CellEditorEventArgs e)
( ( WinComboBox )e.Control).DropDownControl.Width = 100;

Imported from legacy forums. Posted by André (had 337 views)