I am facing an issue with Flutter DataGrid for my tables. I want to use a Widget as the cell type for more customization, but the `ColumnWidthMode.fitByCellValue` doesn't account for Widgets. My current workaround is to change the toString value to simulate the height and width of the widget, but this is not accurate and only calculates the largest cell width on initial load, not updating as more rows are loaded on scroll.
What is the solution for this issue?
As of now, SfDataGrid doesn’t have support to calculate the cell height and width based on the widget that is loaded in the cells. We have calculated the header and row cell height based on the value set in the column.columnName and DataGridCell.value. We have already logged the feature request regarding this. We will implement this feature in any of our upcoming releases.
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience and understanding until then. You can follow up with the below feedback for further follow-up,
As of now, we request that you pass the required width or height in the computeCellWidth and computeCellHeight methods for data rows and computeHeaderCellWidth and computeHeaderCellHeight methods for header cells.
We have already provided the detailed information about how the column sizing works in DataGrid in below UG link,
Thanks for your feedback. Unfortunately, the requested option to use ColumnSizing won't be suitable for our needs as our cells display dynamic data. We require a workaround for calculating widget sizes. Can you recommend a solution? This is critical for us. Also, do you have an estimated timeline for when a fix will be available?
At present, you can only calculate the text size using the relevant methods. To assist you better, could you please provide details on the widget that is being loaded in the cell? Additionally, if you could share an image representation of the DataGrid and your requirements, it would be greatly helpful. We will examine the information and update you with further details.