public Form1()
    {
        InitializeComponent();
        // add first name col
        firstNameColumn.MappingName = "FirstName";
        dataGridTableStyle1.GridColumnStyles.Add(firstNameColumn);
        firstNameColumn.SetCellFormat += new FormatCellEventHandler(ColumnSetCellFormat);
        // add last name col
        lastNameColumn.MappingName    = "LastName";
        lastNameColumn.SetCellFormat += new FormatCellEventHandler(ColumnSetCellFormat);
        dataGridTableStyle1.GridColumnStyles.Add(lastNameColumn);
        // This just sets up a dummy data source, since I don't have a database in this example
        List <PersonTest> peopleList = new List <PersonTest>();

        peopleList.Add(new PersonTest
        {
            FirstName       = "Alan",
            LastName        = "McCormick",
            HighlightPerson = true
        });
        peopleList.Add(new PersonTest
        {
            FirstName       = "John",
            LastName        = "Smith",
            HighlightPerson = false
        });
        BindingSource peopleDataSource = new BindingSource();

        peopleDataSource.DataSource     = peopleList;
        dataGridTableStyle1.MappingName = peopleDataSource.GetListName(null);
        dataGrid1.DataSource            = peopleDataSource;
    }