Results 1 to 27 of 27

Thread: [RESOLVED] [2005] Total count of string in a DataGridView

Threaded View

  1. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Posts
    261

    Re: [2005] Total count of string in a DataGridView

    Here is what i have:
    vb.net Code:
    1. Dim ColumnToSearch As Integer = 42 'number 42 is the column number as per dataset
    2.         Dim StringToFind As String = "Duedate" 'DueDate is the string i want to be count
    3.         Dim cnt As Integer = 0
    4.         Dim s As String
    5.         For Each row As DataGridViewRow In ProjectDescriptionsDataGridView.Rows
    6.             s = row.Cells(ColumnToSearch).Value
    7.             If s.Contains(StringToFind) Then cnt += 1
    8.         Next
    9.         TotalDueDateTextBox.Text = cnt 'i added this to get the value of the counter
    Thanks for the help!
    Last edited by 2005; Jun 10th, 2007 at 02:07 PM.

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