Can't get text value of hidden (visible = false) column..

J

jef

I'm trying to get the value of a cell in my DataGrid_UpdateColumn()
event handler. I have a datagrid with 4 columns:

1 - Name, 2 - Description, 3- Button Column (Edit,Update,Cancel), 4-
Primary Key Value for row

The 4th column is hidden as I need the data for subsequent update to
the database, but don't need to display it in the grid. That said, I
can't seem to figure out how to get the data value out of the column.
If the column is visible I can see and access the value
programatically. I've tried the following techniques:

1. e.item.cells(3).text --- always empty string

2. ctype(e.item.cells(3).controls(0), textbox).text --- has value if
column is visible, empty string when hidden.

Any help is appreciated...

-jef
 
E

Eliyahu Goldin

Hidden columns don't get rendered to the client. If you need to get the
value after postback, hide the column with css rule display:none.

Eliyahu
 
J

jef

Eliyahu... thanks for the reply.. however I'm so new at this I haven't
a clue how to implement your suggestion...
 
E

Eliyahu Goldin

Specify for the column parameter CssClass = Invisible. Make a stylesheet,
whether on the page or in a separate file and put in it Invisible class with
display rule. This what you have to put in the <head> section of your .aspx
file to add a stylesheet:
<style type="text/css">
..Invisible{display:none}
</style>

Eliyahu
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top