setriv.blogg.se

Grandtotal 3
Grandtotal 3










grandtotal 3

If rw.Cells(1).Value.ToString() "Sub-Total" And rw.Cells(1).Value.ToString() "GrandTotal" Then Subtotal += Convert.ToDecimal(DataGridView1.Rows(y).Cells(4).Value.ToString())ĭataGridView1.Rows(indexof_subtotalrow(x)).Cells(4).Value = subtotal If rw.Cells(1).Value.ToString() = "Sub-Total" Thenįor x = 0 To indexof_subtotalrow.Count - 1įor y = Temp To indexof_subtotalrow(x) - 1 Private Sub DataGridView1_CellEndEdit(sender As System.Object, e As ) Handles DataGridView1.CellEndEditĭim indexof_subtotalrow As New List(Of Integer)įor Each rw As DataGridViewRow In DataGridView1.Rows

grandtotal 3

See this if it helps as required 'Load Data In Grid SN Category Quantinty TotalQty Total amount My datagridView looks like as shown below: Private Sub DgvVariationDetails_CellEndEdit(sender As System.Object, e As ) Handles DgvVariationDetails.CellEndEdit

grandtotal 3

SUM += CDec(DgvVariationDetails.Rows(kz).Cells(12).Value)ĭgvVariationDetails.Rows(index).Cells(12).Value = SUM 'this is the formula to get sum of column value where its cell(0) doesnot contain the word 'Sub-Total' 'store the index of that cell to a variable named 'index'ĮlseIf ROWSWITHDATA.Cells(0).Value "Sub-Total" Thenįor cell As Integer = 0 To - 2 Step +1 If ROWSWITHDATA.Cells(0).Value = "Sub-Total" Then 'check if datagridview rows cells (0) in datagridview contains text 'Sub-Total' The codes i tried which produces wrong results: Public Class Contract_Variation_Details Public index, kz As Integerįor Each ROWSWITHDATA As DataGridViewRow In DgvVariationDetails.Rows 'This Variation Quantinty' in datagridview because the other columns to the left of this columns are calculated columns they depend on the input given in the 'This Variation Quantinty'. I want this event to fire immediately under Datagridview1.CellEndEdit when i complete a cell edit under the column named

#Grandtotal 3 code#

Can anyone help me my mistakes to make that code work? please help i'm ready to learn from you friends. For almost 3 days ago i have tried (see myĬodes below) but the codes i wrote does not produce correct result.i mean the summation commingout is not correct. In my datagridview shown below which is not datasource bound i want to write some vb.net codes that will calculate subtotal(s) and finally grandtotal(s) and show the totals to user as you can see in colored cells. Im new to VB.NET programming but have more interest trying things such as programming simple apps using microosft visual studio.












Grandtotal 3