Cannot set the value of a cell
Posted on 2006-06-12
I have a dataGridView and a table as a datasource like so:
Me.dgvLocations.DataSource = table
I then set the DataPropertyName of one of my column to a field in my table like so:
Me.colActivity.DataPropertyName = "cloActivityNote"
The column is a dataGridViewComboBoxColumn.
I then want to set the value of this column to something. So lets set it to the first value in my table (which is the data source):
me.dgvLocations.Rows(0).Cells("colActivity").Value = table.Rows(0).Item("cloActivityNote")
I then good at:
and it seemed to be set fine
But when the form opens/draws itself or whatever the value is not set and I get an error in the event dgvLocations.DataError:
DatagridViewComboBoxCell is not valid
any ideas why?