On Thu, 17 Nov 2022, Aruna Hewapathirane via lazarus wrote:

Hello Everyone,

I managed to get the TListView to work after studying the example Sven
sent. You can see a screenshot here:  https://pasteboard.co/inCtdrOWwAvV.png

How do I set the caption/Title for each column header? How do I set column
header 1 to 'Country' and column header 2 to 'Region' please?

Var
  aCol : TListviewColumn;

begin
  aCol:=Listview1.Columns.Add;
  aCol.Caption:='Country';
  aCol:=Listview1.Columns.Add;
  aCol.Caption:='Region';
end;



Is it possible to sort? By each column ? If so how?

It is possible to sort:

  Listview1.SortColumn:=0; // change to column you need
  Listview1.SortDirection:=sdAscending;
  Listview1.Sort;

Michael.
--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to