From: DavidC on
I have an asp.net web page with a databound ListView showing in Grid format.
I would like to conditionally hide a column in the ListView based on a
checkbox outside of the ListView. I have a ItemDatabound event and thought
the ListViewItemType could be checked but it only has data, insert and blank
properties. The checkbox is called ckHasOT and I was planning to check
something like If ckHasOT.Checked = False Then ....

I would like to hide the column from all Templates (Item, Edit and Insert).
Thanks.

--
David
From: Gregory A. Beamer on


"DavidC" <dlchase(a)lifetimeinc.com> wrote in message
news:3AC46F71-F6CF-40AC-A6D5-7D2767A5A19C(a)microsoft.com...
> I have an asp.net web page with a databound ListView showing in Grid
> format.
> I would like to conditionally hide a column in the ListView based on a
> checkbox outside of the ListView. I have a ItemDatabound event and
> thought
> the ListViewItemType could be checked but it only has data, insert and
> blank
> properties. The checkbox is called ckHasOT and I was planning to check
> something like If ckHasOT.Checked = False Then ....
>
> I would like to hide the column from all Templates (Item, Edit and
> Insert).
> Thanks.

Why a ListView in Grid format instead of a GridView. Much easier to hide a
column, when you use a control that natively supports columnar formats.

Regardless, on binding, you can choose to get rid of anything you want ...
for that post. if you want a turn on and off while painted on the client,
you have to use AJAX for a trip or you have to set up JavaScript to make
certain pieces disappear. A table type of grid is not best served in this
instance, unless you are taking a trip (post or AJAX), as it is not as
conducive to hiding on the fly.

Hope this helps spur some ideas.

--
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
| Think outside the box! |
************************************************