XAML:
Much less flash on screen and less lines, no call to updateLayout necessary:
foreach (DataGridColumn col in dg.Columns) { col.Width = DataGridLength.SizeToCells; col.Width = DataGridLength.Auto; }