asp.net - Cell Value in gridview -


i post several links articles of people asking same question, not on stack overflow, don't know why not work me.

my code is:

int rowindex = ((gridviewrow)(((checkbox)sender).parent.parent)).rowindex; label lbl = new label(); lbl.id = "test" + testing.tostring(); lbl.text = gvbatters.rows[rowindex].cells[1].value; upcompare.contenttemplatecontainer.controls.add(lbl); testing++; 

my problem on line:

lbl.text = gvbatters.rows[rowindex].cells[1].value; 

the problem being value. not this, says i'm missing assembly reference system.web.ui.webcontrols.tablecell. in fact using system.web.ui.webcontrols

when try line this:

lbl.text = gvbatters.rows[rowindex].cells[1].tostring(); 

it shows in update panel label text as:

system.web.ui.webcontrols.datacontrolfieldcell 

i close. google searches should have .value, visual studio says no.

try .text. can't remember sure think text if it's bound field.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -