Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiFiremonkeyIOSOSXWindows

Customize And Sort TListView LiveBindings Data With Firemonkey On Android And IOS

Delphi XE5 Firemonkey ListView LiveBindings Sort TutorialSarina DuPont from Embarcadero has a new tutorial up which demonstrates how to customize your TListViews when using LiveBindings in Delphi XE5 Firemonkey (and AppMethod specifically). Specifically the blog post talks about how to add headers to your TListViews, how to sort the data, and how to add a prefix to each data item in the TListView. This tutorial applies to Delphi XE6 Firemonkey as well and it should run cross platform on Android, IOS, Windows, and OSX. For adding the headers she bound the property from the data called ColorsName onto both the header and the items (ItemHeader.Text and Item.Text respectively). Then she used the FillHeaderCustomFormat property to customize what appears in the header field and used the following code to just get the first letter: SubString(%s, 0, 1). She also changed a property on ColorsName so that it will not repeat and will not shuffle the data. The trick for sorting data appears to be to change the IndexFieldNames property so that it contains the name of the field that you want to sort alphabetically. Lastly in order to apply a prefix the the data you’ll want to add the following code to the FillDisplayCustomFormat property: “My Prefix ” + UpperCase(%s) which will add the words ‘My Prefix ‘ before each item in the TListView. It looks like it can be kind of tricky to get the LiveBindings data in a TListView set up the way you want but once you learn how it works it could really speed up development.

Head over and check out the full blog post plus screen shots on how to sort and customize TListView LiveBindings data.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidC++BuilderCode SnippetDelphiDemoFiremonkeyIOSOSXShowcaseWindows

Powerful Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS


Significant Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux


Professional SVG Icon Image List For Delphi 10.4 FireMonkey On Windows


Top Tips And Tricks To Speed Up Development With Delphi 10.4 FireMonkey On Android and IOS

Sign up for our Newsletter and
stay informed

Leave a Reply