DataAnnotations
-------------------------------------------------------------------------------
Shows how the C1FlexGrid honors DataAnnotation attributes.

DataAnnotation attributes allow developers to add meta-data to their classes,
making it easier to bridge the gap between models and views. For example, you 
may use DataAnnotations to specify how items should be formatted, what their
captions should be, whether they should be editable or displayed.

To use DataAnnotation attributes in your projects, start by adding a reference 
to the System.ComponentModel.DataAnnotations assembly to your project. Note:
the C1FlexGrid supports the annotations defined in .NET 4, so make sure your
System.ComponentModel.DataAnnotations is version 4.0.0.0 or higher.

Then add the attributes to your data objects as usual. For example:

<code>
    class MyDataItem
    {
        // auto-generated CustomerName column header will show "Customer".
        // (even though the property name is "CustomerName")
        [System.ComponentModel.DataAnnotations.Display(Name = "Customer")]
        public string CustomerName { get; set; }

        // auto-generated CustomerID column will be invisible.
        [System.ComponentModel.DataAnnotations.Display(AutoGenerateField = false)]
        public int CustomerID { get; set; }

        // auto-generated "Frequency" column will show values formatted as percentages
        // and will not allow editing.
        [System.ComponentModel.DataAnnotations.DisplayFormat(DataFormatString = "0%")]
        [System.ComponentModel.DataAnnotations.Editable(false)]
        public double Frequency { get; set; }
	}
</code>

The attributes will be honored by all controls that support DataAttributes, including
the C1FlexGrid for WinForms, Silverlight, and WPF, as well as many other controls.