Simplify displaying data in TListView / TTreeView / TVirtualStringTree lazarus / 31-LCL ---------------------------------------------------------------------- CCRDude · 2023-10-04 15:55 Earlier this year I got sick of repeating the "same" code to display data for every data class I wrote. I wanted it to be as simple as: 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   TData = class   published      property Column: string read FColumn;   end;   TDataList = class(TObjectList);...   FDataList: TDataList;...procedure TMyForm.DisplayData;begin   ListView1.DisplayItems(FDataList);   TreeView1.DisplayItems(FDataList);   VirtualStringTree1.DisplayItems(FDataList);end; Generics were my key to implementing this, but the ListView code also supports collections. Rtti and TypInfo allow access to published properties. And thanks to attributes being introduced, I was able to control display format, alternative column titles, image indexes, listview grouping, hierarchical references and more. If you're interested in simplifying data display as well (and use a compiler version that supports attributes), check https://gitlab.com/ccrdude-pascal/firefly-ovm and give me some feedback