TSringgrid first row, multi line lazarus / 21-General ---------------------------------------------------------------------- Hansvb · 2022-06-24 13:43 Hi, How can I create a TStringgrid header column 2 lines? I have this as a quick test but i see still 1 line: 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 procedure TFrm_Main.Button1Click(Sender: TObject);var  i : integer;begin  StringGridMain.RowHeights[0] := 38;   for i:=0 to StringGridMain.Columns.Count-1 do    begin      StringGridMain.Columns[i].Title.MultiLine := true;    end;   StringGridMain.Cells[1, 0]:='Max. verschil' + LineEnding + 'in dagen.';  StringGridMain.Repaint;end; ---------------------------------------------------------------------- paweld · 2022-06-24 13:52 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 procedure TForm1.Button1Click(Sender: TObject);var  i: Integer;begin  StringGridMain.RowHeights[0] := 38;   for i := 0 to StringGridMain.Columns.Count - 1 do    StringGridMain.Columns[i].Title.MultiLine := True;   StringGridMain.Columns[1].Title.Caption := 'Max. verschil' + LineEnding + 'in dagen.';end; ---------------------------------------------------------------------- Hansvb · 2022-06-24 16:13 I see what is changed. I didn't select the right column. But now I get a list index out of bounds error. No matter what column I choose. I have 10 columns and 10 rows. The columns.count gives always 0 even I see 10 columns. ---------------------------------------------------------------------- bytebites · 2022-06-24 17:19 Columns need to be added using object inspector or programmatically. ---------------------------------------------------------------------- paweld · 2022-06-24 17:25 If you are not using columns, then setting the Multiline property does not change anything. You can do this in two ways: - by adding columns and setting the Multiline property to True - setting the DrawCell event (if you are not using columns) Sample in attachment.