Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Total of a column in a Datagridview

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Resolved [RESOLVED] [2005] Total of a column in a Datagridview

    Hello,

    I have a datagridview on my form which populates when the form is loaded.
    As you can see by my code, one of the columns in this datagridview is "Hours".

    Code:
    Try
    dsOvertime = Overtime.Get_Overtime()
    Dim dv As DataView
    dv = New DataView(dsOvertime.Tables(0))
    dgvOvertime.DataSource = dv
    dgvOvertime.ReadOnly = True
    dgvOvertime.Columns("OvertimeID").Visible = True
    dgvOvertime.Columns("Employee").Visible = True
    dgvOvertime.Columns("OvertimeDate").Visible = True
    dgvOvertime.Columns("Hours").Visible = True
    Catch ex As Exception
        MessageBox.Show(ex.ToString)
    End Try
    I would like a textbox at the bottom to show the total of this "hours" column.
    How do I do it please ?

    I've been searching on here and on the following thread jmcilhinney has suggested a line of code, but it relies os the Datagridview being bound to a datatable.

    http://www.vbforums.com/showthread.php?t=439382

    As I don't know how to do this, I can't get any further.
    Last edited by Jonny1409; Aug 13th, 2007 at 09:46 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width