Hide column in ListView

D

DavidC

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.
 
G

Gregory A. Beamer

DavidC said:
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! |
************************************************
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top