diff --git a/source/CHANGELOG.md b/source/CHANGELOG.md index 53e67b28..3c978b0a 100644 --- a/source/CHANGELOG.md +++ b/source/CHANGELOG.md @@ -3,10 +3,13 @@ Development ------------- +NEW: +* Added an error text in the Time Series Properties window when a time series' volume is NaN + FIXED: * Fixed superfluous metadata in export to ZRXP format #126 * Added a check for title uniqueness when a title is edited in the Time Series properties window -* Disable the ability to sort columns in the Time Series Values window +* Disabled the ability to sort columns in the Time Series Values window Version 2.6.0 ------------- diff --git a/source/Views/PropertiesWindow.vb b/source/Views/PropertiesWindow.vb index 65766440..7ea169cc 100644 --- a/source/Views/PropertiesWindow.vb +++ b/source/Views/PropertiesWindow.vb @@ -56,8 +56,34 @@ Friend Class PropertiesWindow ''' ''' the new List of TimeSeries Public Overloads Sub Update(ByRef seriesList As List(Of TimeSeries)) + Me.TimeSeriesBindingSource.DataSource = seriesList MyBase.Update() + + End Sub + + ''' + ''' Handles data binding complete + ''' Adds cell error texts for NaN volumes + ''' + ''' + ''' + Private Sub DataGridView1_DataBindingComplete(sender As Object, e As DataGridViewBindingCompleteEventArgs) Handles DataGridView1.DataBindingComplete + + 'Add cell error texts for NaN volume + Dim colIndex_Volume As Integer + For Each column As DataGridViewColumn In Me.DataGridView1.Columns + If column.Name = "Volume" Then + colIndex_Volume = column.Index + Exit For + End If + Next + For Each row As DataGridViewRow In Me.DataGridView1.Rows + If Double.IsNaN(row.Cells(colIndex_Volume).Value) Then + row.Cells(colIndex_Volume).ErrorText = "Interpretation and/or unit do not allow volume calculation!" + End If + Next + End Sub '''