DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   VB.NET (http://www.daniweb.com/forums/forum58.html)
-   -   Checkbox Value in DataGridView (http://www.daniweb.com/forums/thread93593.html)

ptaylor965 Oct 19th, 2007 6:00 am
Checkbox Value in DataGridView
 
I need to update a cell with the Value from another cell
when a checkbox in the grid is checked but i need it to
update on clicking the checkbox


The only way i have is to do it on CellEndEdit but this requires the user to change cell first

My Code:
Private Sub dgData_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgData.CellEndEdit
' MsgBox(dgData.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)
If dgData.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = "True" Then
dgData.Rows(e.RowIndex).Cells("DespQty").Value = dgData.Rows(e.RowIndex).Cells("Stock").Value
Else
dgData.Rows(e.RowIndex).Cells("DespQty").Value = 0
End If
End Sub


All times are GMT -4. The time now is 1:16 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC