Code:
If grid_selected_item.Rows.Count = 0 Then
grid_selected_item.Rows.Add(txt_article_name.Text, txt_color.Text, txt_size.Text, txt_qty.Text, lbl_selling.Text, txt_discount.Text, GROSS, Total_net, cur_qty, lbl_art_no.Text)
Else
For ichk As Integer = 0 To grid_selected_item.Rows.Count - 1
If txt_article_name.Text <> grid_selected_item.Rows(ichk).Cells(0).Value Then
grid_selected_item.Rows.Add(txt_article_name.Text, txt_color.Text, txt_size.Text, txt_qty.Text, lbl_selling.Text, txt_discount.Text, GROSS, Total_net, cur_qty, lbl_art_no.Text)
Else
If txt_article_name.Text = grid_selected_item.Rows(ichk).Cells(0).Value Then
Dim new_gross As Decimal
Dim new_net As Decimal
Dim new_dis As Decimal
Dim dis_val As Decimal
grid_selected_item.Rows(ichk).Cells(3).Value = grid_selected_item.Rows(ichk).Cells(3).Value + Val(txt_qty.Text)
new_gross = grid_selected_item.Rows(ichk).Cells(3).Value * grid_selected_item.Rows(ichk).Cells(4).Value
new_dis = "." + grid_selected_item.Rows(ichk).Cells(5).Value
dis_val = new_dis * new_gross
new_net = new_gross - dis_val
grid_selected_item.Rows(ichk).Cells(6).Value = new_gross
grid_selected_item.Rows(ichk).Cells(7).Value = new_net
End If
End If
Next
End If
in 1st row it's working and also in 2nd, but in 3rd rows , the data that i enter are getting multiply by the current row . . (Sorry for worse english)
Comment