03-12-2013 03:34 AM
I may have a ListView implemented in C++ with following features.
Some of its data is static. Some of its data may come from run time, e.g., internet, server.
I want the ListView to support headers. But I don't want the headers to be sorted.
Which would be your recommendations as to which DataModel to use?
03-12-2013 04:32 AM
03-18-2013 09:46 AM
03-18-2013 12:10 PM
If you have something coming over the internet, i guess XmlDataModel should be your best bet. All you need to do is set your ListView's dataModel to theXmlDataModel object.
Store the xml file you receive from server to the assets folder or some other folder where your app have access to read the file.
Create a xmldataobject using this data -
XmlDataModel *object = new XmlDataModel();
object-> setSource("your file location");
You can then use it in a ListView to show the data
03-18-2013 01:30 PM
I ran in to a similar problem and this is quite common in a number of different platforms.
My solution is to include a header (recreate the header through the use of a background image and text) in EACH row and set its visibility to false by default. As you're adding the items to your list, filter out which rows you would like to have a row above, and set the visibility of that row's header to true.