Can a ListView column be deleted by name?

  • Thread starter Thread starter Julian Milano
  • Start date Start date
J

Julian Milano

I need to delete a column of a LV by the header name- is that possible?
 
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

I need to delete a column of a LV by the header name- is that possible?
 
Can one be more specific, like:

LV.ColumnHeader("ThisColumnsText").Remove

Instead of cycling thru the collection of headers?
 
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.

Can one be more specific, like:

LV.ColumnHeader("ThisColumnsText").Remove

Instead of cycling thru the collection of headers?
 

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

Back
Top