Home Forums WinForms controls Xceed Grid for WinForms Auto total in onecolumn after value change in another Reply To: Auto total in onecolumn after value change in another

User (Old forums)
Member
Post count: 23064

You can do something like this, in my test I added 2 columns, one was of type bool and the other of type int :

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

AddHandler dataRowTemplate1.Cells(0).LeavingEdit, AddressOf column2_LeaveEdit

Dim row = GridControl1.DataRows.AddNew()
row = GridControl1.DataRows.AddNew()
row = GridControl1.DataRows.AddNew()
row = GridControl1.DataRows.AddNew()
row = GridControl1.DataRows.AddNew()
row = GridControl1.DataRows.AddNew()
row = GridControl1.DataRows.AddNew()
row = GridControl1.DataRows.AddNew()

End Sub

Private Sub column2_LeaveEdit(ByVal sender As Object, ByVal e As Xceed.Grid.LeavingEditEventArgs)
System.Diagnostics.Debug.WriteLine(“Leaving”)

Dim r As Xceed.Grid.DataRow

For Each r In GridControl1.DataRows

If r.Cells(0).Value = True Then

‘…

End If

Next

Imported from legacy forums. Posted by Matt (had 2999 views)