R
rob
I have a BindingSource whose DataSource property is set to a list of
structs (List<MyStruct>). Each property in MyStruct can be read and
writen (get/set).
I also have a DataGridView to which I manually add columns
(dataGridView.Columns.Add). Each column has set the property "ReadOnly"
to false. The DataPropertyName is one of the properties of MyStruct.
ValueType is set to the type that property, i.e. String, Boolean,
etc.Finally the DataSource of dataGridView is set to the above
BindingSource.
All of this works well. I am also able to edit the cells. But as soon
as I exit the cell, i.e. move to another sell, the changes are reverted
to the original value. I suspect that something goes wrong with an
attempted (automatic) synchronization between the datasource, i.e.
BindingSource, and the new value in the cell. I can't figure out what
is going on, though. Any help is appreciated.
Thanks
structs (List<MyStruct>). Each property in MyStruct can be read and
writen (get/set).
I also have a DataGridView to which I manually add columns
(dataGridView.Columns.Add). Each column has set the property "ReadOnly"
to false. The DataPropertyName is one of the properties of MyStruct.
ValueType is set to the type that property, i.e. String, Boolean,
etc.Finally the DataSource of dataGridView is set to the above
BindingSource.
All of this works well. I am also able to edit the cells. But as soon
as I exit the cell, i.e. move to another sell, the changes are reverted
to the original value. I suspect that something goes wrong with an
attempted (automatic) synchronization between the datasource, i.e.
BindingSource, and the new value in the cell. I can't figure out what
is going on, though. Any help is appreciated.
Thanks