2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
SfDataGrid allows you to customize the row height of grid rows using the SfDataGrid.QueryRowHeight event. You can auto fit a row based on its content by using the SfDataGridHelpers.GetRowHeight method. Note: Handled property of the QueryRowHeightEventArgs must be set to true in the QueryRowHeight event for the height changes to take effect.
Note: To skip the header row the condition (e.RowIndex > 0) is added. Screenshot
Sample Link How to adjust row heights of each row based on their content?
|
2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.
This doesn't seem to be working anymore. Doing this exact code I get an IndexOutOfRangeException.
I get the exception on GetRowHeight(e.RowIndex) to get more precise
Hi Thomas,
Thank you for using Syncfusion controls.
We have checked the reported issue “Application crashed when calling DataGrid helper method to calculate row height “dataGrid.GetRowHeight(e.RowIndex)” in Xamarin forms” unfortunately, we cannot be able to replicate the reported issue, and it is working fine from our end. Checked with Group summary, Table summary and unbound row use cases. We have attached the tested sample for your reference in the following link. Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGridDemo519449693
Provide the following details to validate the reported issue further. • Complete code snippet of DataGrid settings. • Xamarin and Syncfusion product version. • Issue reproducing platform at your end.
If possible, please check the attached sample from your end and let us know the issue persist in the provided sample as well? If not kindly modify the sample based on your scenario and revert to us with the details. It will be helpful for us to check on it and provide you the solution.
Regards, Pradeep Kumar B