Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to loop through each row of my datagridview and retrieve each row's cell values, but it is not happening I have tried this code:
VB
For Each row As DataGridView In GridView2.Rows
    if not row.isnewrow then
        grno=row.cells(0).value.tostring
        name=row.cells(1).value.tostring
    end if  // 
Next row

It is giving me exception as isnewrow is not a member of system.windows.forms.datagridview

Can anybody guide me through this?
Posted
Updated 17-Dec-12 5:28am
v2

1 solution

I believe it should be
VB
For Each row As DataGridViewRow In GridView2.Rows
.
 
Share this answer
 
Comments
Pratik65 17-Dec-12 11:40am    
how to clear a particular column from datagridview
Kschuler 17-Dec-12 16:29pm    
What do you mean clear? Clear it of data or completely remove the column from the grid?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900