VB.Net Datagridview Add quantity existing value -
i have indexed unbound datagridview. i'm trying add quantity +
, stands existing quantity plus
.
eg.:- itemcode 001 luxsoap quantity 10 .
again, want add same product quantity 10. if added cells total become 20.
how achieve functionality? i'm using vb.net unbound datagridview.
here code:- dim rnum integer = dgvsale.rows.add()
dgvsale.rows.item(rnum).cells("itemcode").value = txtsalebarcode.text dgvsale.rows.item(rnum).cells("prname").value = txtsaleitemname.text dgvsale.rows.item(rnum).cells("price").value = txtsaleprice.text dgvsale.rows.item(rnum).cells("grqty").value = txtsaleqty.text dgvsale.rows.item(rnum).cells("amnt").value = txtsaleamount.text dgvsale.rows.item(rnum).cells("invnum").value = txtinvno.text dgvsale.rows.item(rnum).cells("gstamnt").value = gstcollect.text 'dgvsale.rows.item(rnum).cells("qtyinhand").value = lbldisplayqtyinhand.text dim found boolean = false if dgvsale.rows.count > 0 'check if product id exists same quantity each row datagridviewrow in dgvsale.rows if convert.tostring(row.cells(0).value) = txtsalebarcode.text andalso convert.tostring(row.cells(3).value) = txtsaleqty.text 'update quantity of found row row.cells(0).value = convert.tostring(txtsaleqty.text + convert.toint16(row.cells(3).value)) found = true end if next
Comments
Post a Comment