reading hidden data from a gridview control

P

Paul

Hi I am trying to read hidden data from a gridview control. This works if
the data is visible but if the column is not visible it does not return
anything, thanks.
Int32 itemp = Convert.ToInt32(e.Row.Cells[6].Text);
 
P

Paul

Hi, thanks for the responses. I ended up converting the bound column to a
template column with a lable (lblDiscID) then used Int32 itemp
=Convert.ToInt32 ( (e.Row.Cells[6].FindControl("lblDiscID") as Label).Text);
which seemed to work. Guess there are a few ways to do it.
--
Paul G
Software engineer.


Mark Rae said:
Hi I am trying to read hidden data from a gridview control. This works if
the data is visible but if the column is not visible it does not return
anything, thanks.
Int32 itemp = Convert.ToInt32(e.Row.Cells[6].Text);

When you set a webcontrol's Visible property to false, it does not even get
rendered to the client browser.

Therefore, you will need to use CSS to hide it client-side.

Lots of examples of this are available:
http://www.google.co.uk/search?sour...n-GBGB252GB252&q=GridView+column+hide+display
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top