Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to get the value of gridview item 1

Status
Not open for further replies.

LonnieJohnson

Programmer
Joined
Apr 16, 2001
Messages
2,628
Location
US
I have a grid view that I need to iterate through all the rows and evaluate value in column 1.

How do I retrieve the value of a column of each row?

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Use the RowDataBoundEvent. YOu can get the value of the column by index or name as each row is bound.
 
It's an unbound gridview. Does that make a difference?


ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
at some point are you binding the gridview to a datasource?
 
If not, something like this then:
Code:
        Dim i As Integer
        For i = 1 To GridView1.Rows.Count - 1
            Dim dgv As GridViewRow
            dgv = GridView1.Rows(i)
            if dgv.Cells(0).text = "someval" then
              'do stuff
            end if

        Next i
 
The last post was most helpful. Thanks again. You're a great help.

I am just beginning. No classes. Was thrown into finishing a project that someone else started.

I really appreciate you.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
No problem.. glad to help :) That's what these forums are for...

And, sometimes it's the best way to lear, just by doing...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top