ASP.Net DataGrid Template column when inivisible

S

spidur1

I have a datagrid with template comlumns that have textboxes which are
populated via the ItemDataBound command.
However, when I set a column to be invisible, I can no longer retreive
the value of that textbox even though the viewstate is enabled. I can
still retrieve the value of a databound column, so why not a templated
column when it's invisible?
 
E

Eliyahu Goldin

On what stage do you try to retreive the value? Note, that if you set the
column property Visible=false, the column won't be rendered to the client.
If you think that could be the problem, make the column invisible with css
rule display:none.

Eliyahu
 
S

spidur1

Yeah the problem is that it's not being redered to the client. How do
I use the css rule display:none? Thanks for your help!
 
S

spidur1

It is not being rendered to the client. That's the problem. How do I
set the css rule?
Thanks for your help!
 
E

Eliyahu Goldin

Make a stylesheet, either on the page or in a separate file, and add a rule
like
..Invisible{display:none}
Set CssClass property of the column to "Invisible"

Eliyahu
 
E

Eliyahu Goldin

Put

<ItemStyle CssClass="Invisible"></ItemStyle>

within <TemplateColumn> tags

Eliyahu
 
P

Patrick Olurotimi Ige

spidur1 what Eliyahu is advicing is to have:-
<ItemStyle CssClass="Invisible"></ItemStyle>
where Invisible will be the CSS u created in th CSS file.
Hope this helps
Patrick
 

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,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top