2 Replies - 314 Views - Last Post: 17 February 2013 - 06:41 AM Rate Topic: -----

#1 stenhoeve  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 06-February 13

datgridviewtextboxcolumn value

Posted 16 February 2013 - 02:24 PM

Just a brief question. How can I get the value of a couple of datgridviewtextboxcolumn. If the value is > then 0 I want the whole line with the different columns stored in a text file. So I want to check the whole datagrid for values > 0 in column 3.
Is This A Good Question/Topic? 0
  • +

Replies To: datgridviewtextboxcolumn value

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3176
  • View blog
  • Posts: 10,636
  • Joined: 12-December 12

Re: datgridviewtextboxcolumn value

Posted 16 February 2013 - 04:24 PM

For Each row As DataGridViewRow In YourGrid.Rows
    If row.Cells("column_id").Value = 0 Then    'or index
        'Do Something
    End If
Next

You may have to convert the value to a number.

Erm, a one-minute Google found this code :whistling: (less than a minute even..)

This post has been edited by andrewsw: 16 February 2013 - 04:25 PM

Was This Post Helpful? 0
  • +
  • -

#3 stenhoeve  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 06-February 13

Re: datgridviewtextboxcolumn value

Posted 17 February 2013 - 06:41 AM

View Postandrewsw, on 16 February 2013 - 04:24 PM, said:

For Each row As DataGridViewRow In YourGrid.Rows
    If row.Cells("column_id").Value = 0 Then    'or index
        'Do Something
    End If
Next

You may have to convert the value to a number.

Erm, a one-minute Google found this code :whistling:/> (less than a minute even..)

Thank you, of course I used google but somehow didn't get the right results. Itried to use the code but on the word "In" I get an error saying Expression expected. I can't figure out why.

I got it, I mistyped a word. Thanks again:)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1