Click here to Skip to main content
12,549,492 members (42,344 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET
i am using 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 )
but always it returns the value ""(Blank/Null)

Help me
Posted 28-Jan-13 17:25pm

1 solution

Rate this: bad
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:

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.

AnkurGupta OM 29-Jan-13 4:13am
sir when i use row 1 then i find an error
out of index
Edo Tzumer 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2016
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