Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 28-Jan-13 18:25pm
ankur7891.4K

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi Ankur,
 
Perhaps datagridview1.rows(0) is referring to the Header Row of the DataGridView,
Try rows(1) instead:
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
  Permalink  
v2
Comments
AnkurGupta OM at 29-Jan-13 4:13am
   
sir when i use row 1 then i find an error
out of index
Edo Tzumer at 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)

  Print Answers RSS
0 OriginalGriff 7,215
1 DamithSL 5,114
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,747
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100