Results 1 to 2 of 2

Thread: datagrid value

  1. #1
    Join Date
    May 2009

    Unanswered: datagrid value

    hi everybody

    i have form which holds a datagrid "DELIVERY_CHALLAN_SUB_QRYDataGridView"

    i have a filed/textbox "qty" in data grid which is populated by the user

    the field/textbox "qty" is in column 3

    i want the sum of all the rows of the column "qty" to be displayed on the form in a text box

    please help me


  2. #2
    Join Date
    Jun 2005
    Hi krishnanhemanth .. Form Me I Can Solve It in 2 ways ...
    1. Connect to database and Select Sum(qty) and display it
    2. with For loop ... Code:
    Dim Sum_Qty as double = 0
    For i as integer = 0 to DELIVERY_CHALLAN_SUB_QRYDataGridView.ROWS.Count
    If Sum_Qty=0 then
    'This to Get First QTY
    Sum_Qty= DELIVERY_CHALLAN_SUB_QRYDataGridView.rows(i).Cells (3).value
    Sum_Qty=(Sum_Qty + DELIVERY_CHALLAN_SUB_QRYDataGridView.rows(i).Cells (3).value)
    End If
    Textbox1.tex = sum_Qty

    I Hope this Will Help You ...
    Good Luck
    Sami Al Damiri ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts