When creating XAML applications using ListView and GridView controls for Windows 8, you probably want your applications to look like “standard” applications. You can reverse-engineer existing applications, but Microsoft makes it a little easier than that. In the documentation, if you search a bit, you’ll find two pages that list some sample, standard DataTemplate examples you can use for your own applications.
For the ListView control, look here: http://bit.ly/R8WUHy
For the GridView control, look here: http://bit.ly/Tc5JQG
You’ll find two problems with these templates. First, they include hard-coded text, and it’s up to you to replace the hard-coded text with binding expressions that work with your own data source. In addition, some of the templates don’t work well with “real” data, and you may need to modify them slightly to work with your bound data. In general, however, these templates can save you a lot of time. Review them all to see what Microsoft has provided. If there’s not an exact match for your application, you can at least use one of these as a starting place.
Ken Getz is a Visual Studio expert with over 25 years of experience as a successful developer and consultant. He is a nationally recognized author and speaker, as well as a featured instructor for LearnNowOnline.