If you mean by total
is a Label .. then you may put your code in your datagridview_cellvalidated
event ..
Dim total as Integer
Private Sub dvJOBranch_CellValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dvJOBranch.CellValidated
Dim tXS, tS, tM, tL, tXL As Integer
For i = 0 To dvJOBranch.Rows.Count - 1
tXS += dvJOBranch.Rows(i).Cells("XS").Value
tS += dvJOBranch.Rows(i).Cells("S").Value
tM += dvJOBranch.Rows(i).Cells("M").Value
tL += dvJOBranch.Rows(i).Cells("L").Value
tXL += dvJOBranch.Rows(i).Cells("XL").Value
Next
total = tXS + tS + tM + tL + tXL
'MsgBox(total)
End Sub
In your ToolStripButton put the code Msgbox(total)