0

I have a DataGridView with a ComboBoxColumn in it. The ComboBoxColumn has more than 50 items in it. When I click the combobox, all 50+ items are displayed stretching right to the bottom of the screen. Is it possible to display only the first 10 items when the combobox is clicked and then be able to scroll through the other items while the combobox is still open?

user3450855
  • 41
  • 1
  • 4

2 Answers2

0

I haven't tried but, it can be done by assigning MaxDropDownItems property to 10. To assign the property you have to get that combobox control on EditingControlShowing event.

private void DataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
    ((ComboBox)e.Control).MaxDropDownItems = 10;
}

I hope this will help you.

Shell
  • 6,818
  • 11
  • 39
  • 70
0

You probably looking for MaxDropDownItems in ComboBoxColumn

Alex des Pelagos
  • 1,170
  • 7
  • 8