How to make DBGrid show data type and length? lazarus / 16-Databases ---------------------------------------------------------------------- Jonvy · 2022-06-15 08:20 Dear all, I want to display table's fied type and data length together with table name in DBGrid in my program. As the attachment, in postgres Admin, it has this function. How can I do, so my program can get same effect? Best regards, Jonvy ---------------------------------------------------------------------- Zvoni · 2022-06-15 09:08 Quote from: Jonvy on June 15, 2022, 10:20:41 amAs the attachment, in postgres Admin, it has this function.What makes you think, it's a DBGrid PostGres-Admin is using? QuoteHow can I do, so my program can get same effect?You don't with DBGrid EDIT: Hold on. Just got an idea.... You need two FixedRows and your underlying SQL has to Ship the Field-Types as the first record IIRC, the first fixed row gets the Field-Names, everything else is the returned data ---------------------------------------------------------------------- wp · 2022-06-15 11:03 The DBGrid column header can be changed at runtime. For any column (index i), get the required information from the associated field and add it to the current title after a LineBreak. When you set the column's header MultiLine to true the header will be displayed in two lines. You also need to double the height of the title row for which you need to cast TDBGrid to a descendent type in order to access the protected RowHeights property. 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  TMyGrid = type(TDBGrid);...  for i := 0 to DBGrid1.Columns.Count-1 do begin    F := DBGrid1.Columns[i].Field;    s := GetEnumName(TypeInfo(TFieldType), integer(F.DataType));  // requires unit TypInfo in "uses"    Delete(s, 1, 2);    if (F is TStringField) then s := s + '(' + IntToStr(F.Size) + ')';    DBGrid1.Columns[i].Title.Caption := DBGrid1.Columns[i].Title.Caption + LineEnding + '[' + s + ']';    DBGrid1.Columns[i].Title.MultiLine := true;    DBGrid1.Columns[i].Title.Alignment := taCenter;  end;  TMyGrid(DBGrid1).RowHeights[0] := 2*DBGrid1.DefaultRowHeight; Find a tested sample project in the attachment ---------------------------------------------------------------------- Jonvy · 2022-06-15 14:16 Thanks wp, it solves my problem.