Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using asp.net with language as vb .
I take a grid view with having two textfield
tb1 as cell1,tb2 as cell 2 in datagrid view
now i want to fetch values from those textfield i m using the code like



datagridview1.rows(0).cells(1).text(value is not found in asp.net )
but always it returns the value ""(Blank/Null)

Help me
Posted

1 solution

Hi Ankur,

Perhaps datagridview1.rows(0) is referring to the Header Row of the DataGridView,
Try rows(1) instead:
C#
datagridview1.rows(1).cells(1).text(...);


Also a possibility -
Not clear from the question, but it can also be that the text is inside a control inside the cell, in which case you'd first have to reach the control and then the text property of it.


Cheers,
Edo
 
Share this answer
 
v2
Comments
ankur789 29-Jan-13 4:13am    
sir when i use row 1 then i find an error
out of index
Joezer BH 29-Jan-13 4:17am    
Did you try debugging, and to stop on this line and see the values of the properties of datagridview1.rows(0).cells(1)?

Does the cell contain a control inside which is holding the text?

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