Aan Aan - 1 year ago 112
C# Question

How to hide a column in a ListView control?

How can I hide a column in a

control, without setting the column
property to

Also, can I lock the
of a column?

Answer Source

Not very clear what matters here C++Cli tag, but:

I presume that if you're talking about a columns in ListView, you're in details view of the control. There is no builtin Hide/Show column way in ListView, as much as I'm aware of, so one of solutions can be just remove that column form UI.

To do that in most smooth way possible just call your ListView column regeneration code in between


/*Manipulate column here*/


The data which is visible on ListView always remains "in your hands", so at the moment you will decide to show the column again, just show the column and fill ListView again.

Hope this helps.