A DataView is one of the many data-bound controls that can use Stores and Models. It uses XTemplates to render data making it quite versatile.
Let us make a variation of our earlier XTemplate example to show a few more capabilities. Suppose we want to show a list of employees (and quite a strange-looking bunch they are too!) similar to the following screenshot:
The icons are courtesy of Dante Michael Afrondoza (http://www.smashingmagazine.com/2008/11/05/dressup-avatars-icon-set/). Let's look at how this was achieved.
First, we will use a simple class to present an employee as follows:
public class Employee { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public bool IsManager { get; set; } public DateTime DateOfBirth { get; set; } public int Age { get { return DateTime.Today.Year - DateOfBirth.Year; } } }
We will also display this data in our XTemplate, using the following...