Reputation: 330962
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?
Upvotes: 1
Views: 1365
Reputation: 330962
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.
Upvotes: 1