2

Coming from years of .NET Framework programming experience, I wonder if there is anything in Android out of the box that resembles the .NET WPF component DataGrid: it should be something like an Android AdapterView, where you set the Adapter (ItemsSource in .NET) and it will show up with a table whose rows are populated with data coming from the adapter (I tried using a ListView but it doesn't show like a table).

Thank you in advance

user1737538
  • 497
  • 2
  • 7
  • 16
  • 1
    do u mean that: https://developer.android.com/reference/android/widget/GridView.html ? – Budius Sep 30 '14 at 13:04
  • I don't think that GridView is an equivalent of the DataGrid: as I can understand, the GridView lays out its children in a Grid, one after the other (like in a PhotoGallery: a new line is started if the component has reached the right end of the screen). Whereas the DataGrid displays its items like records of a database table. Can parameters change the GridView default behaviour? – user1737538 Sep 30 '14 at 13:57
  • ah... ok, now I understood what you meant. 1 line = 1 data item, but with data fields separate by columns. So the answer is no. You'll use a ListView and built the adapter `getView` method to get the looks you need/want – Budius Sep 30 '14 at 14:03
  • Thank you Budius, I was also going in that direction. It is just a little cumbersome, compared to the .NET WPF solution. It's not so easy to build a View where you take into account the columns width (only the TableLayout does it automatically, as I can see). – user1737538 Sep 30 '14 at 15:11
  • I would say forget a bit about .net because a mobile app is much different. Nobody is trying to do DB management on mobile. `LinearLayout` have `layout_weight` that can be used to create fixed widths between elements that are proportional to the parent view (the `ListView`) – Budius Sep 30 '14 at 15:15
  • Take a look at http://www.androidjetpack.com/Home/AndroidDataGrid – flexicious.com Jan 18 '15 at 01:48
  • Very nice, but I was looking for a free component. – user1737538 Jan 18 '15 at 08:19

0 Answers0