I would like to know how to limit the number of items to show in DataGridViewComboBoxColumn
.
In simple ComboBox
we can do it as:
comboBox1.IntegralHeight = false; //this is necessary to make it work!!!
comboBox1.MaxDropDownItems = 3;
But how to do the same in DGV
s comboBox`?
When creating ComboBoxColumn
there is no IntegralHeight
property.
I have figured it out by my self, by subscribing to
DataGridViewEditControlShowing
event, and with this code inside of it:Now the dropdown menu works, it shows as many rows as set for the
MaxDropDownItems
property.For Visual Basic