Articles in this section
Category / Section

How to set column width and row height of the grid shown in WinForms MultiColumnComboBox's drop down?

1 min read

Setting column width and row height

Setting column width and row height of the grid shown in WinForms MultiColumn ComboBox drop down can be achieved by handling the DropDown event of the MultiColumnComboBox. In the event handler code, use ColWidths and RowHeights properties of the embedded grid in the MultiColumnComboBox.ListBox.

C#

private void MultiColumnComboBox1_DropDown(object sender, EventArgs e)
{
    GridControl grid = this.MultiColumnComboBox1.ListBox.Grid;
    for (int i = 1; i <= dt.Rows.Count; i++)
    {
       grid.ColWidths[i] = 100;
       grid.RowHeights[i] = 35;
    }
}

VB

Private Sub MultiColumnComboBox1_DropDown(ByVal sender As Object, ByVal e As EventArgs) Handles MultiColumnComboBox1.DropDown
    Dim grid As GridControl = Me.MultiColumnComboBox1.ListBox.Grid
    For i As Integer = 1 To dt.Rows.Count
       grid.ColWidths(i) = 100
       grid.RowHeights(i) = 35
    Next i
End Sub

Sample: https://help.syncfusion.com/support/samples/KB/Tools.Windows/KB_MultiColumnComboBox/Tools_WF_KB_MultiColumnComboBox.zip

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied