Home All Groups Group Topic Archive Search About

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

Author
20 Mar 2005 6:32 PM
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

Author
20 Mar 2005 10:04 PM
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

Show quoteHide quote
"jef" <jeffreyfrab***@gmail.com> wrote in message
news:1111343578.946673.33750@f14g2000cwb.googlegroups.com...
> 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
>
Author
21 Mar 2005 12:16 AM
jef
Eliyahu...  thanks for the reply.. however I'm so new at this I haven't
a clue how to implement your suggestion...
Author
21 Mar 2005 8:33 AM
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

Show quoteHide quote
"jef" <jeffreyfrab***@gmail.com> wrote in message
news:1111364185.438774.326970@l41g2000cwc.googlegroups.com...
> Eliyahu...  thanks for the reply.. however I'm so new at this I haven't
> a clue how to implement your suggestion...
>