Add ColumnAutoWidthMode#361
Conversation
|
Do you have any thought on how a column should behave when there's no rows and the ColumnAutoWidthMode is set to Cells? It's currently sized to the header. I'm using the sample application, and even if the rows are added early, the column widths are calculated earlier, and this makes it difficult to solve ColumnAutoWidthMode.Cells during the first size pass. |
|
I think if you add a condition for ColumnAutoWidthMode in |
w-ahmad
left a comment
There was a problem hiding this comment.
Thanks for the updates @Mangepange, I tried these changes and they work fine, except when the property is changed at runtime using XAML HotReload. We need to ensure that the TableView responds to property changes during runtime.
Also, please add a sample page to demonstrate this new change.
This is a suggestion for how to solve #358.
I added a new property to TableView and TableViewCell. The property sets a ColumnAutoWidthMode which describes how the column should calculate its width when sizing to its content (doubleclicking on the column separator, or when no startup size is set).
It's sort of the same as the functionality in DataGrid, https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/sizing-options-in-the-datagrid-control#sizing-columns-and-column-headers, but not including "Pixel" or "Star" modes. I think that those two modes are better defined when the user sets the actual Width value.
I'm a bit unsure how to test regarding the fix for WinUI issue 9860 in TableViewCell.MeasureOverride.