SteveInBeloit
Well-known member
- Joined
- May 22, 2006
- Messages
- 132
- Programming Experience
- 10+
Hi,
I have a DataGridView that has a combo box on it. When the combo box is pulled down and a value selected, regardless if it is the same value that was originally in there, I need to change the value of two other columns on that row to nulls.
Then when I do the .Update, the of course need presisted to the underlying Database.
I am having some problems finding the correct place to do this.
This is what I have tried to do:
On the MyDataDridView_cellClick I put
I put a break point there and watched the code execute, it changes the value, and I can see that on the form. But when I do the .Update, it never makes it back to the dataTable first. What should I do here? Is there a property I should set on the cell after I change the value to indicate it needs to be written back to the dataTable?
Then I thought maybe make the change directly in the DataTable. But
Me.DataTable. lets me pick rows OR columns, don't see how I can narrow it down to the individual cell I want to update.
Thanks,
Steve
I have a DataGridView that has a combo box on it. When the combo box is pulled down and a value selected, regardless if it is the same value that was originally in there, I need to change the value of two other columns on that row to nulls.
Then when I do the .Update, the of course need presisted to the underlying Database.
I am having some problems finding the correct place to do this.
This is what I have tried to do:
On the MyDataDridView_cellClick I put
VB.NET:
If e.ColumnIndex = 0 Then
DataGridView3.Rows(e.RowIndex).Cells("tkRejectedTime").Value = System.DBNull.Value
DataGridView3.Rows(e.RowIndex).Cells("tkRejectedBy").Value = System.DBNull.Value
End If
I put a break point there and watched the code execute, it changes the value, and I can see that on the form. But when I do the .Update, it never makes it back to the dataTable first. What should I do here? Is there a property I should set on the cell after I change the value to indicate it needs to be written back to the dataTable?
Then I thought maybe make the change directly in the DataTable. But
Me.DataTable. lets me pick rows OR columns, don't see how I can narrow it down to the individual cell I want to update.
Thanks,
Steve