|
@@ -21,6 +21,7 @@ using System.Windows.Threading;
|
|
|
using InABox.Clients;
|
|
|
using InABox.Core;
|
|
|
using InABox.WPF;
|
|
|
+using Microsoft.CodeAnalysis.CSharp.Syntax;
|
|
|
using Microsoft.Xaml.Behaviors;
|
|
|
using Syncfusion.Data;
|
|
|
using Syncfusion.DocIO.ReaderWriter.DataStreamParser.Escher;
|
|
@@ -977,6 +978,7 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
private void DataGrid_CurrentCellValueChanged(object? sender, CurrentCellValueChangedEventArgs e)
|
|
|
{
|
|
|
+ // Are we sure that this function is ever useful? It seems that since the data in the grid hasn't been updated by this point, this function is essentially useless (the data is updated in EndEdit). Probably need to check the GridCheckBoxColumn
|
|
|
var headerrows = HasOption(DynamicGridOption.FilterRows) ? 2 : 1;
|
|
|
if (e.RowColumnIndex.RowIndex < headerrows)
|
|
|
return;
|
|
@@ -1153,6 +1155,10 @@ namespace InABox.DynamicGrid
|
|
|
var colno = DataGridItems.Columns.IndexOf(mappedname);
|
|
|
var column = Data.Columns[colno];
|
|
|
var value = DataGridItems.Rows[iRow][mappedname];
|
|
|
+ if(value is DBNull)
|
|
|
+ {
|
|
|
+ value = CoreUtils.GetDefault(column.DataType);
|
|
|
+ }
|
|
|
|
|
|
UpdateData(new Dictionary<CoreColumn, object?>() { { column, value } });
|
|
|
|