Blog

Using Standard Templates for ListView and GridView

By Ken Getz | December 21, 2012

Thumbnail for 559

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.



Ken Getz

Ken Getz is a featured instructor for several of our Visual Studio courses. He is a Visual Basic and Visual C# expert and has been recognized multiple times as a Microsoft MVP. Ken is a seasoned instructor, successful consultant, and the author or co-author of several best-selling books. He is a frequent speaker at technical conferences like Tech-Ed, VSLive, and DevConnections and he has written for several of the industry's most-respected publications including Visual Studio Magazine, CoDe Magazine, and MSDN Magazine.


This blog entry was originally posted December 21, 2012 by Ken Getz