Certain DataGridViewComboBoxColumn.AutoSize values leads to System.ArgumentException

184 Views Asked by At

I work in Visual Studio v12.0.31101 Update 4, .NET Framework v.4.5.50938.

There's a DataGridView with some TextBox columns and one ComboBox column. DGV is binded to some DataTable, Combobox is binded to another DataTable. Everything works fine, until I set ComboBoxColumn.AutoSize paratemer to one of these values:

  • AllCells
  • AllCellsExceptHeader
  • DisplayedCells
  • DisplayedCellsExceptHeader

In that case I get DataGridView exception: SystemArgumentException: Illegal value in DataGridViewComboBoxCell.

Does it mean I shouldn't use these parameters with ComboBoxColumn or there's a workaround?

0

There are 0 best solutions below