Home Forums WinForms controls Xceed Grid for WinForms ComboBoxEditor – can I change its height? Reply To: ComboBoxEditor – can I change its height?

User (Old forums)
Member
Post count: 23064

You can do the same (set FitHeightToEditors to true) on the fly when the ComboBox is being activated, and then set it back to false when it is deactivated.  Use the ActivatingControl/DeactivatingControl events to accomplish this.

e.g. :

private void Form1_Load( object sender, EventArgs e )

{

    gridControl1.Columns[

“SupplierID” ].CellEditorManager.ActivatingControl += new CellEditorEventHandler( SupplierID_CellEditorManager_ActivatingControl );

    gridControl1.Columns[

“SupplierID” ].CellEditorManager.DeactivatingControl += new CellEditorEventHandler( SupplierID_CellEditorManager_DeactivatingControl );

}

void SupplierID_CellEditorManager_ActivatingControl( object sender, CellEditorEventArgs e )

{

    e.Cell.ParentRow.FitHeightToEditors =

true;

}

void SupplierID_CellEditorManager_DeactivatingControl( object sender, CellEditorEventArgs e )

{

    e.Cell.ParentRow.FitHeightToEditors =

false;

}

 

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