DataGrid-Column widths not updating on ItemsSource change

后端 未结 4 728
执笔经年
执笔经年 2020-12-19 16:43

XAML:


    

        
4条回答
  •  醉话见心
    2020-12-19 17:10

    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;
                }
    

提交回复
热议问题