Wrapping Text on Columns of Rows
Hello!
I currently have a sfdatagrid that holds product information. I would like to allow wrapping of text in certain columns. For example. the user may enter a long description of the product. I would like this cell's height to then expand if the user enters in text that goes beyond the cell's width and to wrap. This would increase the Cells height but also the entire row's height as well. I would like this done completely pragmatically if possible without having to use styles if possible. However, I am open to using any method of getting this implemented. Can someone help me implement this functionality?-
What is currently looks like:
How I would like it to look like:
Hi Jacob,
Your requirement, "Wrapping Text on Columns of Rows" in SfDataGrid can be achievable. You can set the height of the row based on the content after editing by using the CurrentCellEndEdit and QueryRowHeight Events.
Please find the below mentioned User Guide Documentation link to update the row height while editing.
UG Link: Row
Height Customization in WPF DataGrid control | Syncfusion
We hope this helps to achieve your requirement. Please let us know, if need any further assistance.
Regards,
DhivyaBharathi Dakshinamurthy
I tried implementing this inside my application, however
this.dataGrid.GridColumnSizer.GetAutoRowHeight(e.RowIndex, gridRowResizingOptions, out autoHeight)Would keep coming back with the autoheight of 0. Do you know why autoheight would continue to show as 0 when this method is ran?
Hi Jacob,
Based on the provided information, we have analyzed the reported scenario. Unfortunately, we are unable to replicate the reported scenario, it works as we expected. We prepared a simple sample to achieve your requirement. Could you please check this sample and let us know.
- If possible, could you please replicate the reported scenario in the provided sample.
- If possible, could you please provide the sample with the reported issue occurs.
Providing this information will help us better understand the issue and work towards finding a solution promptly.
Regards,
Chidanand M.
Attachment: SfDataGrid_Demo4_8_8d14f62f.zip
- 3 Replies
- 3 Participants
-
JA Jacob
- Dec 15, 2023 02:25 PM UTC
- Dec 22, 2023 01:32 PM UTC