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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unable to access some grid data

Status
Not open for further replies.

threeo

Programmer
Mar 31, 2005
49
US
anyone know why.....

i have a grid on a page which has 3 colums and looks like this:

EDIT | 25067 | 78655
EDIT | 19876 | 23478
EDIT | 78545 | 87554

when i attempt to access the data from the grid like:

ogrid.Items(0).Cells(1).Text i get "25067"

which is what i would expect.

but for some reason i can NOT access the data in the last column...

ogrid.Items(0).Cells(2).Text i get ""

in fact, all column 3 items come out as ""

ogrid.Items(0).Cells(2).Text i get ""
ogrid.Items(1).Cells(2).Text i get ""
ogrid.Items(2).Cells(2).Text i get ""

anyone know why???

 
I juste created a quick sample to test. I created a grid with a template column. I was able to access the text value of the cell of the template column with the code that you were originally using.
Code:
'I just did a response.write after the grid was bound.
ogrid.Items(0).Cells(2).Text

so, I am not sure where you are calling the code to grab the value. Your original code should work.
 
wow...
now i'm really confused.
i can clearly see my grid on the page with the data
i also did a
Response.Write(oGridAttributes.Items(0).Cells(2).Text)
and still get ""

i guess i will have to chalk this one up as "unsolvable" and store the values in a hidden field.

damnit
 
i wonder if this would duplicate the problem....

do a postback to the page but leave your grid unaffected (so now you've lost the dataset it is bound to)

and THEN try to response.write the cell data

also: did the cell you grabbed the data on.....did it have an edit template?

mine does (although the edit wasn't clicked)
 
A postback does not affect my results. Yes the template column has a textbox in the edititem. You are doing something wrong somewhere that you are overlooking. Maybe you can post all of your codebehind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top