Invisible Cells in GridView

D

Dot Net Daddy

Hello,

Is there a way to access the invisible cells in the GridView from
code-behind.

Been trying this, but isn't working

For i = 0 To GridView1.Rows.Count - 1
If GridView1.Rows(i).Cells(1).Text.Equals("Y") Then
GridView1.Rows(i).Cells(0).Font.Bold = False
End If
Next
 
D

Dot Net Daddy

No error messages at all. But doesnt return a result.

The reason is Cell(1) is invisible. A friend just told that for
security reasons the data in invisible cells are not populated. I have
just been advised to use DataKeys, but I don't know how to do.

I have assigned the DataKeyMember = Column1, but don't know how to
retrieve data using DataKeys.

any ideas?
 
M

Mark Rae

any ideas?

GridView1.DataSource = <DataSet / DataReader / whatever>
GridView1.Cells(0).Visible = True
GridView1.DataBind()
GridView1.Cells(0).Visible = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top