Interesting problem. I have a datagrid with several columns which are
bound to an Access database. Here's the situation...I'm concerned with
the 3rd column.

This is what I'd like to happen... when the 3rd column(is a checkbox)
is checked then column 4(TIME_USER) would be populated with the
current time

Basically, this application is meant to keep track of tasks that the
user has to do at a certain time of the day. When the user checks the
checkbox it would record the time in the database for that task as to
when they did it.

I found some code from a forum that i changed to fit my needs, but
it's not working..

If e.ColumnIndex = 3 Then
 
DataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit)
            Dim isChecked As Boolean =
DirectCast(DataGridView1.Item(e.ColumnIndex, e.RowIndex).Value,
Boolean)
            If isChecked Then
                DataGridView1.Item("TIME_USER", e.RowIndex).Value =
usr.ToUpper & " " & Time_Checked
         End If
End If

Reply via email to