473,407 Members | 2,629 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,407 software developers and data experts.

Can a ListView column be deleted by name?

I need to delete a column of a LV by the header name- is that possible?

--
|
+-- Julian
|
Nov 21 '05 #1
3 4713
Hi,

Try this:
For Each ch As ColumnHeader In LV.Columns
If (ch.Text = "<column_header_text") Then

LV.Columns.Remove(ch)

Exit For

End If

Next

"Julian Milano" <jd****@datafast.net.au> wrote in message
news:ut**************@TK2MSFTNGP09.phx.gbl...
I need to delete a column of a LV by the header name- is that possible?

--
|
+-- Julian
|

Nov 21 '05 #2
Can one be more specific, like:

LV.ColumnHeader("ThisColumnsText").Remove

Instead of cycling thru the collection of headers?

--
|
+-- Julian
|
"Siva M" <sh******@online.excite.com> wrote in message
news:uw**************@TK2MSFTNGP12.phx.gbl...
Hi,

Try this:
For Each ch As ColumnHeader In LV.Columns
If (ch.Text = "<column_header_text") Then

LV.Columns.Remove(ch)

Exit For

End If

Next

"Julian Milano" <jd****@datafast.net.au> wrote in message
news:ut**************@TK2MSFTNGP09.phx.gbl...
I need to delete a column of a LV by the header name- is that possible?

--
|
+-- Julian
|

Nov 21 '05 #3
A similar feature is available in .NET 2.0 - ListView.Columns.RemoveByKey().
This method accepts the column header's name instead of the text though.

"Julian Milano" <jd****@datafast.net.au> wrote in message
news:uz**************@TK2MSFTNGP12.phx.gbl...
Can one be more specific, like:

LV.ColumnHeader("ThisColumnsText").Remove

Instead of cycling thru the collection of headers?

--
|
+-- Julian
|
"Siva M" <sh******@online.excite.com> wrote in message
news:uw**************@TK2MSFTNGP12.phx.gbl...
Hi,

Try this:
For Each ch As ColumnHeader In LV.Columns
If (ch.Text = "<column_header_text") Then

LV.Columns.Remove(ch)

Exit For

End If

Next

"Julian Milano" <jd****@datafast.net.au> wrote in message
news:ut**************@TK2MSFTNGP09.phx.gbl...
I need to delete a column of a LV by the header name- is that possible?

--
|
+-- Julian
|


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Angelina | last post by:
Hi, I wanted to add a few items to my listview control. The values of these will be obtained from other controls on my interface. When the user clicks the select button, they will need to be...
6
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline();...
2
by: Aron Henning | last post by:
I have a ListView that contains the subfoldes of a local drive. Whan i click on a subfolder the listbox should display the subfolders of this folder instead. the funktion is as follows: private...
0
by: Andrew | last post by:
If item is a ListViewItem and str is a string, why do the following two lines not have the same effect ? item.SubItems.Add(new ListViewItem.ListViewSubItem()).Text = str;...
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
1
by: Mamatha | last post by:
Hi I have one application ,that diplays data from database into the listview control.While adding data to the listview i want to display an icon to the leftside of the first column's data.Here...
0
by: sonu | last post by:
Hi all, I have a listview control which has four columns like { Col1, Col2, Col3, Col4}. I add data in listview like this, dim lvitem as listviewItem
5
by: Kay | last post by:
Hi all, I know that I can get the value of a particualar column in a list view by something like this: lvwRoster.SelectedItems(0).SubItems(2).Text However, is it possible to get the value by...
0
by: Marius Manolea | last post by:
Hi, I have a strange problem, I don't receive any modifications from listview in edit mode (OldValues & NewValues are empty) <asp:ListView ID="lvEditPersonRoles" runat="server"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.