Posted 31 October 2023, 6:08 pm EST
Hi,
If you want to resize the height of particular rows then, you can handle the loadedRows event and set the height property of a specific row in the handler of this event.
To increase the default size of all the rows please handle the initialized event and set the defaultSize property of rows property of FlexGrid to the required size.
initializeGrid(flex: wjcGrid.FlexGrid) {
// Increase the default size of the rows
flex.rows.defaultSize = 68;
// ...code
}
Also, if you want to manually break the cell content by inserting “\n” (newLine) then to see the changes in that Column please set the multiLine property of that column to true.
For example, in this sample, the height of all the rows is set using the defaultSize property, and the height of rows 1, 4, 7, and 10 is set to 120. Please refer to this sample for reference: https://stackblitz.com/edit/angular-ivy-jdbqnz
Please refer to these API links for more information:
- defaultSize: https://developer.mescius.com/wijmo/api/classes/wijmo_grid.rowcollection.html#defaultsize
- loadedRows: https://developer.mescius.com/wijmo/api/classes/wijmo_grid.flexgrid.html#loadedrows
- multiLine: https://developer.mescius.com/wijmo/api/classes/wijmo_grid.column.html#multiline
If the content of cells in a Column is large then you can set the wordWrap property of the column. This will allow the content of cells to wrap to fit the available column width. However, to see the wrapped text the height of the rows are needed to be increased. Please use the autoRowHeights property of the FlexGrid to auto-size the rows as per the content.
Please refer to this sample for reference: https://stackblitz.com/edit/angular-ivy-xj3qc1
However, if you have a large number of rows, then it is recommended to manually auto-size only the rows that are present in the view. This can be done by using the autoSizeRow() method of the FlexGrid class. Please refer to this DEMO for reference: https://developer.mescius.com/wijmo/demos/Grid/Sizing/Auto-sizeRowsAsync/angular
Please refer to the below API links for more information:
- autoRowHeights: https://developer.mescius.com/wijmo/api/classes/wijmo_grid.flexgrid.html#autorowheights
- wordWrap: https://developer.mescius.com/wijmo/api/classes/wijmo_grid.column.html#wordwrap
- autoSizeRow: https://developer.mescius.com/wijmo/api/classes/wijmo_grid.flexgrid.html#autosizerow
If you face any issues while following the above approaches then please let us know.
Regards
Anirudh