ListView or DataGrid

In my contact management app I was looking for a way to list contacts in a table. The simplest UIElement object that would allow me to do this.

The ListView UIElement seemed the most appropriate, it list a data items, pretty much does what you want.

With a listView one can display tabular data…..and that’s about it(well, you can do other things). This is all fine until we want more CRUD like behaviour. That’s where DataGrid comes in. The DataGrid class allows one to one binding with models which does make it easier for displaying and editing model data. The one on one binding also gives auto column generation which I don’t find particular useful as it gives column names such as this. “FirstName”, “LastName”. See, no spaces between the fields, not sure how useful that is really as you probably want your own names with spaces. Of course you can override this and provide your own data binding and replace the column names.

Simply put, if you want editable data use DataGrid, else ListViews. Or you could just use DataGrid and disable editing until you need. it

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s