Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#8778 from derekagorhom/FIXES_BU…
Browse files Browse the repository at this point in the history
…G_IN_LEVEL_DIALOGUE

Fixes issue where the Levels/Labels dialog does not label the last level well
  • Loading branch information
N-thony authored Apr 4, 2024
2 parents 22f51a6 + d40e4bc commit 358d82c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions instat/ucrFactor.vb
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ Public Class ucrFactor
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Sub _grdSheet_AfterCellEdit(sender As Object, e As CellAfterEditEventArgs) Handles _grdSheet.AfterCellEdit
Private Sub _grdSheet_CellEditTextChanging(sender As Object, e As CellEditTextChangingEventArgs) Handles _grdSheet.CellEditTextChanging

Dim bValid As Boolean = True
'do levels entry validation
If _grdSheet.ColumnHeaders(e.Cell.Column).Text = DefaultColumnNames.Level Then
If Not IsNumeric(e.NewData) Then
If Not IsNumeric(e.Text) Then
MsgBox("Levels must be numeric values", MsgBoxStyle.Information, "Invalid Value")
bValid = False
ElseIf e.NewData.Contains(".") Then
ElseIf e.Text.Contains(".") Then
MsgBox("Levels must not be decimal", MsgBoxStyle.Information, "Invalid Value")

bValid = False
Expand All @@ -207,13 +207,13 @@ Public Class ucrFactor
If bValid Then
'set the new data before calling OnControlValueChanged
'very important especially when writing to the parameter value
_grdSheet(e.Cell.Row, e.Cell.Column) = e.NewData
_grdSheet(e.Cell.Row, e.Cell.Column) = e.Text
'this will raise ControlContentsChanged event
'and also update parameter and R code with the values
OnControlValueChanged()
e.Cell.Style.BackColor = Color.Gold
Else
e.EndReason = EndEditReason.Cancel
'Todo what will happen if the text is not valid
End If

End Sub
Expand Down Expand Up @@ -936,4 +936,5 @@ Public Class ucrFactor
lblSelected.Visible = iSelectCol > 0
SetToggleButtonSettings()
End Sub

End Class

0 comments on commit 358d82c

Please sign in to comment.