Reputation: 486
I'm currently trying to set the last column in a DataGrid to take up any remaining horizontal space in the grid by setting its width to star. Here is my current attempt:
dataGrid.Columns[10].Width = DataGridLengthUnitType.Star // doesn't work
Anyone know if/how this can be achieved? Thanks in advance for any help.
Upvotes: 2
Views: 1692
Reputation: 1542
Try this:
dataGrid.Columns[10].Width = new DataGridLength(double value here for initial size, DataGridLengthUnitType.Star);
Upvotes: 4