Quantcast
Channel: Sarina DuPont, Product Manager RAD Studio
Viewing all articles
Browse latest Browse all 132

Displaying Cloud Based Data with A to Z ListView Headers

$
0
0

With TListView and LiveBindings, it is easy to display cloud based data in a sorted manner using listview headers.

Working with sorted data

If the data is already sorted, i.e. we have two columns, one for recipe title and one for the food category, you can just bind ‘Category’ into ItemHeader.Text to display food category headers for each of the recipes. This displays each recipe under its category header.

In the Structure pane, under ListView1-LiveBindings-LinkListControlToField1, you can further customize the style of your header.

Select your ItemHeader.Text to Category binding in the LiveBindingsDesigner, and then in the Object Inspector, toggle between the three FillHeaderCustomFormat options.

The application consists of the following components:
User Interface
  • TListView, aligned to the client
  • TToolbar, aligned to the toolbar
  • TLabel, aligned to Contents and parented to TToolbar
  • TStyleBook (displaying premium EmeraldDark style)
BaaS
  • TBackendQuery (for querying existing data that lives in the cloud and was added via the BaaS web interface)
  • TKinveyProvider (AppKey, AppSecret and MasterSecret have been set; you can also use TApp42Provider and TParseProvider)
  • TRestResponseDataSetAdapter
  • TFDMemTable
If you wanted to alphabetically sort the recipes in the list without displaying them in a grouped fashion under category headers, you could bind both Item.Text and ItemHeader.Text into FDMemTable1 - RecipeTitle. Then set FillHeaderCustomFormat to SubString(%s, 0, 1).

Viewing all articles
Browse latest Browse all 132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>