According to http://msdn.microsoft.com/en-us/library/ms810291.aspx, you can’t change the ReadOnly attribute of an Expression based column in your DataTable. I need to figure out a way to Evaluation the Expression on a DataTable column, then set the .Expression = null, then allow the editing of that Column:
The following code does not work, because when you set the Expression == null, it resets the value in the DataTable to DBNull:
_persistedDataTable.Columns[currentDataColumn.ColumnName].Expression = null;
_persistedDataTable.Columns[currentDataColumn.ColumnName].ReadOnly = false;
My idea is that i copy the current DataTable to a new DataTable, row by row without preserving the schema, allowing me to edit the new DataTable values (whether or not they were derived by Expressions or not)… I am just not sure how to do this.
Here is how i did it: