I would like to insert a value into an unbound column(6) in my databound datagridview. The value will be based on the value in databound column(3). The following For Each Row Statement works fine, but it doesn't work when I apply a filter to the datagridview by using the bindingsource.filter method. I'm filtering the datagridview with a ComboBox (SelectedIndexChanged Event). I would appreciate any help. Thanks!
For Each Row As DataGridViewRow In dgv.Rows
If IsDBNull(row.Cells(3).Value) Then
row.Cells(6).Value = "Available"
Else
row.Cells(6).Value = "Unavailable"
End If
Next
Filter:
Shared Sub StandardToolStripComboBox_SelectedIndexChanged(ByVal Sender As Object, ByVal e As EventArgs)
LLBindingSource.Filter = "Code =" & "'" & CodeToolStripComboBox.Text & "'"
End Sub
For Each Row As DataGridViewRow In dgv.Rows
If IsDBNull(row.Cells(3).Value) Then
row.Cells(6).Value = "Available"
Else
row.Cells(6).Value = "Unavailable"
End If
Next
Filter:
Shared Sub StandardToolStripComboBox_SelectedIndexChanged(ByVal Sender As Object, ByVal e As EventArgs)
LLBindingSource.Filter = "Code =" & "'" & CodeToolStripComboBox.Text & "'"
End Sub