Reputation: 668
I am really new to Android development and I am trying to create a table with sortable columns for an Android App. Is there one that is similar to .NET's DataGridView
or Details
View
of .NET's ListView
control?
Example:
Thanks!
Upvotes: 1
Views: 1279
Reputation: 513
Android has "listview", which is used for creating scrolling lists. You will need to implement the headers and then sorting by columns yourself separately. (Each header should listen for clicks.) To make this work as expected you want to design it for complex sorts, i.e. sort by this column, then that column, then a third column, etc.
To create the columns for holding the data, you need to supply the list view with an xml file that is your layout for an individual row. You then can bind your data to the row of the list view through the use of an AdapterView (such as SimpleCursorAdapter, ArrayAdapter, or others.) The normal adapters like SimpleCursorAdapter assume that they'll be supplied with Strings, you can override this by using a custom ViewBinder.
So long story short - no there is not a sortable table in android, but you should be able to create your own using the basic android components.
Upvotes: 1