AutoResizeColumns
is from the namespace System.Windows.Forms
. I'm not sure if that will work with WPF or not. But you can set the width of the column to NAN
to make it resize
In your XAML
if you name your GridView as follows:
<GridView x:Name="dataGridView">
Then you could resize all columns with this
foreach (GridViewColumn c in dataGridView.Columns)
{
c.Width = 0; //set it to no width
c.Width = double.NaN; //resize it automatically
}