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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16336 |

    Hi,

    I have a ComboBoxEditor for one of the columns on my grid. However, it seems to me that the text area of the WinComboBox cannot fit into the cell entirely because the bottom part of the text on the cell got truncated partially when I’m trying to edit the cell. (The text looks fine when the focus is away from the cell though.)

    I got rid of the problem if I set the following:

    gridControl.DataRowTemplate.FitHeightToEditors = true;

    However, the height of each row on the grid has become larger and I don’t prefer this appearance. Is there a way to change the height of the ComboBoxEditor?  If not, is there other way to solve the problem I mentioned above?

    Thanks in advance.

     

    Imported from legacy forums. Posted by Sop (had 704 views)

    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)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.