Posted 14 August 2025, 2:20 am EST
Hi
I have an issue with the columns where I want to adjust the width of column as per the container.
If the text autowraps the height of the row is not adjusted. What is the way out?
Regards
David
Forums Home / ComponentOne / WPF Edition
Posted by: david on 14 August 2025, 2:20 am EST
Posted 14 August 2025, 2:20 am EST
Hi
I have an issue with the columns where I want to adjust the width of column as per the container.
If the text autowraps the height of the row is not adjusted. What is the way out?
Regards
David
Posted 15 August 2025, 4:30 am EST
Hi David,
To replicate your use-case scenario, we created a sample application where one column(named “Message”) of the flexgrid is star-sized with word-wrap set to “true”.
In this case, both the column “Message” and the rows have automatic sizing, therefore the cells will be measured with infinite size. The content will grow horizontally, but not vertically.
It is designed this way because of performance reasons and it is intentional.
As a workaround, you can make the column “Message” limited to some specific width. If that is made, the rows will grow automatically to fit the content:
ItemGrid.Columns["Message"].Width = new GridLength(300);
ItemGrid.DefaultRowHeight = GridLength.Auto;
Kindly refer to the attached sample for full implementation. See NET8_Upd.zip
If this isn’t exactly your requirement, please modify the attached sample to show the issue so we can investigate further.
Thanks & regards,
Aastha