TsWorksheetGrid - make row height dependent on cell content. lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- straetch · 2016-07-01 14:32 [Before this question was erroneously posted in an existing thread. Clumsy. No intention to hijack someone else's communication.] I  search for a solution to programmatically extend the cell height when the content exceeds the one line cell space in a TsWorksheetGrid, with WordWrap set. I found a method UpdateRowHeights. But this is a protected method for TsWorksheetGrid. The way it is defined, I suppose it would potentially extend all row heights of the entire grid in one go. I look for some means that gives me more control, e.g. to avoid extremely high rows in case of cells with very small column width. Is there a way to access the number of lines occupied (even when invisible) by the cell content? I tried using Canvas.TextWidth as a basis (following a previous post), but that does not work well since WordWrap is active for the cell. The spreadsheet has 6000 rows and 14 columns, so changing the widths of the columns is not an option. Windows7, Lazarus 1.6.0 with FPC 3.0.0, fpspreadsheet 1.6.2 ---------------------------------------------------------------------- wp · 2016-07-01 16:46 There is another protected method which is better-suited to your requirement: AutoAdjustRow(ARow: Integer). It has been made public in the new revision which I just uploaded to svn. If you want to continue using the release version 1.6.2 then you must cast the worksheetgrid to a derived class in order to access the protected method: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TWorksheetGridOpener = class(TsWorksheetGrid); procedure AutoRowHeight(AGrid: TsWorksheetGrid; ARow: Integer);begin  TWorksheetGridOpener(AGrid).AutoAdjustRow(ARow);end; ---------------------------------------------------------------------- straetch · 2016-07-02 07:45 Works like a charm. Many thanks for your quick response. ---------------------------------------------------------------------- straetch · 2016-07-04 12:22 By digging deeper, I found a protected method of TsCustomWorksheetGrid: GetCellHeight. I applied the TWorksheetGridOpener from your earlier post. The method allows me to control the automatic row adjusting. It works great. Thank you for your gridopener solution. I learned something that was new to me.