Torna al Thread

Private Sub GrdDettagli_CellValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles GrdDettagli.CellValidated RicalcolaTotali() End Sub Private Sub RicalcolaTotali() ' Dichiari una variabile di tipo double che memorizzerà il totale Dim DblTotale As Double ' Cicli tutte le righe e sommi il valore della colonna che ti interessa For Each CurRow As DataGridViewRow In Me.TuoDataGridView If IsNumeric(CurRow.Cells("NomeColonna").Value) Then DblTotale += CurRow.Cells("NomeColonna").Value End If Next ' Visualizzi il risultato nella textbox Me.TuaTextBoxTotale.Text = DblTotale End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5