tags:

views:

1392

answers:

2

how to make column invisible of wpf listview? (one way is to set width property to minimum lenth but that not proper solution) can anyone help me?

+1  A: 

There is a pretty simple explanation of one way of doing it here.

Find and remove your column:

var temp = myGridView.Columns[0];
myGridView.Columns.RemoveAt(0);

Insert the column back in the view:

myGridView.Columns.Add(temp );
temp.Width = 0;
temp.Width = Double.NaN;

Remove it from the columns collection when you want to hide it and reinsert the column when you want to display it again.

HakonB
A: 

To hide the header of a ListView you can modify the Visibility property of the ColumnHeaderContainer by overriding the style locally.

<ListView>
<ListView.View>
    <GridView>
        <GridView.ColumnHeaderContainerStyle>
           <Style>
               <Setter Property="FrameworkElement.Visibility" Value="Collapsed"/>
           </Style>
        </GridView.ColumnHeaderContainerStyle>
        <GridView.Columns>
            ...
        </GridView.Columns>
    </GridView>
</ListView.View>

Sauron