473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Hiding a column in the listview control

111 100+
Hi All,
I am using a listview control in my usercontrol so that it can be used in more than one form. This user control has one column extraw, so i want to make it invisible depending on the form it is being used.
I am using table in the listview control for formating purpose. In this table I want to hide a column. Is it posible to hide the column?. I am facing the problem because I cant catch the row its showing null values.

Code goes like this:
<LayoutTemplate>
<div style="height:222px; border: solid 1px #7f7f7f;border-collapse:collapse;">
<table id="ManageContent" runat="server" class="grid" cellspacing="0" border="0">
<tr id="row" runat="server">
<th style="width:10px" runat="server" id="thImgRadio"></th>
<th style="margin:0px;margin-left:0px;width:20px" runat="server" id="thImgcheck">
<asp:CheckBox ID="chkCheckAll" runat="server" OnCheckedChanged="CheckALL" AutoPostBack="true"/>
</th>
<th style="width:130px">
<asp:Image Style="float: left" AlternateText="Click on header to sort by Name"
ID="imgSortName" runat="server" ImageUrl="~/App_Themes/iDeliverDefault/gridImg/header-sortable.PNG" />
<asp:LinkButton ID="btnSortName" runat="server" Style="color: White;" Text="Name"
CommandName="Sort" CommandArgument="report_desc" />
</th>
<th style="width:170px">
<asp:Image Style="float: left" ID="imgSortNetwork" AlternateText="Click on header to sort by Network"
runat="server" ImageUrl="~/App_Themes/iDeliverDefault/gridImg/header-sortable.PNG" />
<asp:LinkButton ID="btnSortNetwork" runat="server" Style="color: White;" Text="Network"
CommandName="Sort" CommandArgument="from_path,url_link" />
</th>
<th style="width:90px">
<asp:Image Style="float: left" ID="imgSortStatus" AlternateText="Click on header to sort by Status"
runat="server" ImageUrl="~/App_Themes/iDeliverDefault/gridImg/header-sortable.PNG" />
<asp:LinkButton ID="btnSortStatus" runat="server" Style="color: White;" Text="Status"
CommandName="Sort" CommandArgument="released" />
</th>
<th style="width:90px">
<asp:Image Style="float: left" ID="imgSortPublished" AlternateText="Click on header to sort by Published"
runat="server" ImageUrl="~/App_Themes/iDeliverDefault/gridImg/header-sortable.PNG" />
<asp:LinkButton ID="btnSortPublished" runat="server" Style="color: White;" Text="Published"
CommandName="Sort" CommandArgument="published_date" />
</th>
<th style="width:90px">
<asp:Image Style="float: left" ID="imgSortModified" AlternateText="Click on header to sort by Modified"
runat="server" ImageUrl="~/App_Themes/iDeliverDefault/gridImg/header-sortable.PNG" />
<asp:LinkButton ID="btnSortModified" runat="server" Style="color: White;" Text="Modified"
CommandName="Sort" CommandArgument="file_last_modified" />
</th>

<th visible="false"></th>

</tr>
<tr id="itemPlaceholder" runat="server" style="table-layout:fixed"/>
</table>
</div>
</LayoutTemplate>

<ItemTemplate>
<tr id="Itemrow" runat="server" class='<%# Container.DataItemIndex % 2 == 0 ? "row" : "altrow" %>'>
<td id="thImgRadio" runat="server" style="width:10px">
<asp:ImageButton ID="imgUG" runat="server" ImageUrl="~/App_Themes/TheHartford/Images/option.png"
CommandName="select" />
</td>
<td id="thImgCheck" runat="server" class="rownum" style="width:20px">
<asp:CheckBox ID="chkManageContent" runat="server"/>
</td>
<td style="width:130px">
<div style="width:130px; overflow:hidden">
<nobr>
<asp:Label ID="lblReport_Desc" runat="server" Text='<%# Eval("report_desc")%>' ToolTip='<%# Eval("report_desc")%>'></asp:Label>
</nobr>
</div>
</td>
<td style="width:170px">
<div style="width:180px; overflow:hidden">
<nobr>
<asp:Label ID="lblUrl" runat="server" Text='<%# Eval("url_link").Equals("NA") ? Eval("from_path") : Eval("url_link") %>'
ToolTip='<%# Eval("url_link").Equals("NA") ? Eval("from_path") : Eval("url_link") %>' ></asp:Label>
</nobr>
</div>
</td>
<td style="width:90px">
<ajax:ConfirmButtonExtender ID="cbeImageStatus" runat="server"
TargetControlID="imgbtnStatus" ConfirmText='<%# Eval("released").ToString()=="1"? "Are you sure you want to change the status to offline?" : "Are you sure you want to change the status to online?" %>'/>
<nobr>
<asp:ImageButton ID="imgbtnStatus" runat="server" ImageUrl='<%# Eval("released").ToString()=="1"? "../App_Themes/iDeliverDefault/Images/online.gif" : "../App_Themes/iDeliverDefault/Images/offline.gif"%>'
OnClick="imgbtnStatus_Click" CommandArgument='<%#Eval("p_d_report_url_id")%>' style="cursor:pointer" AlternateText="Click to change status."/>
<%# Eval("released").ToString()=="1"? "Online":"Offline"%></nobr>
</td>
<td style="width:90px">
<%# DateTime.Parse(Eval("published_date").ToString()). ToShortDateString()%>
</td>
<td style="width:90px">
<%# DateTime.Parse(Eval("file_last_modified").ToString ()).ToShortDateString()%>
</td>
<td visible="false">
<asp:Label ID="lblReportUrlID" Text='<%# Eval("p_d_report_url_id")%>' Visible="false" runat="server"></asp:Label>
</td>
</tr>
</ItemTemplate>

The one in the bold I want to hide according to the screen.

Thanks in advance.

Thanks & Regards
Bharath Reddy VasiReddy
Aug 21 '08 #1
0 2280

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Geert-Pieter Hof | last post by:
Hello, I use a ListView control (report view) to show the user a summary of error messages. The width of the column that holds the error messages is such that no horizontal scrollbar is needed....
0
by: rmorvay | last post by:
I have successfully integrated sorting in the listview control with the following code: Private Sub ListView_ColumnClick(ByVal sender As Object, ByVal e As...
3
by: Steve | last post by:
I have windows form with ListView control. The ListView control has few columns which user can sort by clicking the column header. I want the column header have the small triangle indicator of...
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
6
by: Maileen | last post by:
Hi, I have a listview in report mode. I have 3 columns in this listview and 1 column i would like to hide it from user's view. i tried to give width = 0 but user is still able to resize column...
0
by: Dominique | last post by:
Hello, The aexview is showing four or five columns and most of the time only one or two is (are) useful in our environment Also the view is too big for our usual screens so I would like : - to...
9
by: active | last post by:
I need a control that displays a grid of rectangles. That is, like a brick wall except the rectangles are lined up. In VB6 I used such a control (may have been called FlexGrid but I'm not...
4
by: Cheryl | last post by:
Hi! It seems that the listview column does not contain an option called "Hide". Any suggestions to implement such a hiding function excepting setting the column width = 0? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.