1

Somewhere in code I have to set the width of a GridViewColumn to 0, and in another place I want to set it to "Auto" just like in the xaml, instead of reinventing what the xaml is doing when using "Auto".

Any ideas on how to do this in code?

Joan Venge
  • 315,713
  • 212
  • 479
  • 689

1 Answers1

1

I found the answer here.

col.Width = Double.NaN;

That's actually the default value, so if you don't set Width, the column will be auto-sized by default.

Joan Venge
  • 315,713
  • 212
  • 479
  • 689