My DataGrid is bound to a DataTable. The DataTable has numeric types which AllowDBNull.
gridDataTable = new DataTable("MyDataTable");
gridDataTable.Columns.Add(new DataColumn("LowCutOff", typeof(double)));
gridDataTable.Columns.AllowDBNull = true;
gridDataTable.Columns.DefaultValue = DBNull.Value;
columnsGrid.ItemsSource = gridDataTable.DefaultView;
I can add rows to the DataTable/Grid which have DBNulls via code no problem, like this...
gridDataTable.Rows.Add("", TypeCode.Double, "", false, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value);
But there is no way I can enter null numeric values through the UI. Leaving a cell blank is the same as leaving non-numeric text in the cell, it goes into an error mode and I can't input normally after that.
Even buggering around with the CellEditEnding event for hours hasn't solved the problem
even though I've updated the underlying DataTable successfully withe the DBNull value for that location. The interface still thinks it's in an error state after that and the editcancel won't fix that either.
(Go back to WinForms??)