我目前正在尝试将 DataGrid 中的最后一列设置为通过将其宽度设置为星形来占用网格中任何剩余的水平空间。这是我当前的尝试:
dataGrid.Columns[10].Width = DataGridLengthUnitType.Star // doesn't work
有人知道是否/如何实现这一目标吗?预先感谢您的帮助。
最佳答案
试试这个:
dataGrid.Columns[10].Width = new DataGridLength(double value here for initial size, DataGridLengthUnitType.Star);
关于c# - 在代码隐藏中将数据网格列宽设置为星号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32490775/