My application adds information to a grid desktop control and for two of the column adds combo box with options that the users can change if they want. I want to be able to detect if/when the user changes a value in the combo box so I can update other cells in the grid desktop.
The loop that adds the information to the sheet is:
For x As Integer = row To unitInformation.Samples.Count - 1
sampleInformation = unitInformation.Samples(x)
.Cells(row, 0).Value = sampleInformation.SampleNumber
.Cells(row, 1).Value = DustWipeComponentToString(sampleInformation.SampleType)
.Controls.AddComboBox(row, 1, ComponentOptions)
.Cells(row, 2).Value = sampleInformation.SampleDescription
.Cells(row, 3).Value = sampleInformation.Concentration & " " & UnitsToString(sampleInformation.ConcentrationUnit)
.Cells(row, 4).Value = sampleInformation.Result.ToString
.Controls.AddComboBox(row, 4, ResultOptions)
.Cells(row, 5).Value = sampleInformation.Comment
If sampleInformation.Result = DustWipeResults.Positive Then
.Rows(row).SetFont(PositiveFont)
End If
row += 1
Next
And the combo boxes options are stored in two list that are define at the top of the form:
Dim ResultOptions As List(Of String) = New List(Of String)(New String() {“Positive”, “Negative”})
Dim ComponentOptions As List(Of String) = New List(Of String)(New String() {“Floor”, “Window Sill”, “Window Well”})
I want to be able to detect when a user changes a row from Positive to Negative, and vice versa, or changes, for example, a Floor to a Window Well. Is there a way to add a handler to do this?