Checkbox Value in DataGridView

Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Oct 2006
Posts: 169
Reputation: ptaylor965 is an unknown quantity at this point 
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Checkbox Value in DataGridView

 
0
  #1
Oct 19th, 2007
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
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC