I am currently working in VB.NET Visual Studio Professional with an SQL back end. I have a DataGridView
that populates a list of parts with two CheckBox
columns in column positions 0 and 1. Checkbox column in the 0 position is labeled as "Complete" and the checkbox column in position 1 is marked as "Missing." As an operator cuts parts they mark the row as complete or missing with a checkbox in either column. If a part is missing then when the user click the checkbox in the "missing" column it opens a new form as a dialog result. At this point the new form opens and the checkbox in that row under the missing column is checked. However, the operator can click a button on the dialog result to cancel the entry. My problem occurs here. Upon clicking the cancel button the form closes but the checkbox on the original DGV remains check and for some reason I can not get it to uncheck itself. The DGV is data binded to an sql table however the first two checkbox columns are manually added in the design form. Any advice on how to get this checkbox to uncheck itself? Here is my code this far:
ElseIf dr = Windows.Forms.DialogResult.Cancel Then
MsgBox(Row_Index)
MsgBox(DGVList.CurrentCell.ColumnIndex)
'DGVList(Row_Index, 1).Value = True
DGVList(DGVList.CurrentCell.ColumnIndex, DGVList.CurrentCell.RowIndex).Value = False
'DGVList("Missing", Row_Index).Value = False
MsgBox("Hot part has been canceled by user. This part will not be marked as missing.")
End If
My row_index
is declared at the top of the sub and both the message boxes seem to correlate to the correct position. To add to this brain tease, on rows 2 and rows 4 the code works, but no where else.