ASP.Net DataGrid Template column when inivisible

  • Thread starter Thread starter spidur1
  • Start date Start date
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?
 
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
 
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!
 
It is not being rendered to the client. That's the problem. How do I
set the css rule?
Thanks for your help!
 
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
 
Put

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

within <TemplateColumn> tags

Eliyahu
 
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
 
Back
Top