reading hidden data from a gridview control

  • Thread starter Thread starter Paul
  • Start date Start date
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);
 
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
 
Back
Top