Anytime the visibility property is set to false on any
server control then
that control is not rendered.
If you wish to remove a column programmatically you can use
the RemoveAt
method of the datagrid columns (ver 1.x),
dgResults.Columns.RemoveAt(3). If I remember correctly you
have to do this
after the databinding; but once removed the relationship is
gone and so is
the viewstate for that column (I could be wrong on viewstate
since I never
really checked).
Now if those data columns are never used then I would
optimize the data
query and remove them.
Pam
-----Original Message-----
From: Allen Moon [mailto:howlmoon clearwire.net]
Sent: Sunday, March 04, 2007 6:16 AM
To: aspnet-datadisplaycontrols aspadvice.com
Subject: [aspnet-datadisplaycontrols] RE: Visible=False in
DataGrid &
GridView
Eric
WHy have you not unchecked the automatic created columns and
then just
created the column that you need.
----- Original Message -----
From: "eric van buren" <ericvanburen msn.com>
To: <aspnet-datadisplaycontrols aspadvice.com>
Sent: Saturday, March 03, 2007 4:59 PM
Subject: [aspnet-datadisplaycontrols] Visible=False in
DataGrid & GridView
>I have a datagrid in an older 1.1 app where a large
number of the
>columns have the property set visible=false. Do these
columns
>actually become rendered and databound in the Datagrid
and just aren?t
>visible to the user thus making the viewstate large or
are they just
>not created at all? Is this behavior any different
with a GridView?
>Ideally, I would like to have have my grid just not
create these
>columns at all when not needed to improve
> performance but dynamically creating them seems like a
lot of work.
>
>
>
> Thanks.
>
>
>
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
|