Nie można dowiedzieć się, jak konwertować ciągi klas na datagrid

Próbuję uzyskać „firstName, lastName, assocID itp.” aby wyświetlić w datagrid na moim formularzu. Jestem nowym programistą / dzieckiem skryptu, przepraszam, jeśli to głupie pytanie. Po prostu nie wiem, jak wywołać associateList.firstName do czytelnego wpisu datagrid.

Chciałbym, aby datagrid używał każdego powiązania w associateList, jeśli to możliwe. W jakiś sposób rozważał podstawowy licznik na indeksie.

Doceniane są również inne informacje o tym, jak piszę kod. Jestem nowy i samoukiem.

W skrócie : Chcę, aby stowarzyszeni wyświetlali w datagrid za pomocą kolumn, aby oddzielić informacje.

Nazwa datagrid to dataGridAssociates na formularzu Windows.

namespace Associate_Tracker
{
    public partial class Form1 : Form
    {
        public class Associate
        {
            //No idea wtf {get; set;} does but I read that I need it?

            public string firstName { get; set; }
            public string lastName { get; set; }
            public string assocRFID { get; set; }
            public int assocID { get; set; }
            public bool canDoDiverts { get; set; }
            public bool canDoMHE { get; set; }
            public bool canDoLoading { get; set; }
        }

        public Form1()
        {
            InitializeComponent();
        }

        private void buttonAddAssoc_Click(object sender, EventArgs e)
        {
            #region Datagrid Creation -- Name: dt
            DataTable dt = new DataTable();
            dt.Columns.Add("First Name");
            dt.Columns.Add("Last Name");
            dt.Columns.Add("RFID");
            dt.Columns.Add("Associate ID#");
            dt.Columns.Add("Diverts");
            dt.Columns.Add("MHE");
            dt.Columns.Add("Loading");
            dataGridAssociates.DataSource = dt;
            #endregion

            //First & Last name splitter
            string allValue = textBoxAssocName.Text;
            string firstNameTemp = String.Empty;
            string lastNameTemp = String.Empty;
            int getIndexOfSpace = allValue.IndexOf(' ');

            for (int i = 0; i < allValue.Length; i++)
            {
                if (i < getIndexOfSpace)
                {
                    firstNameTemp += allValue[i];
                }
                else if (i > getIndexOfSpace)
                {
                    lastNameTemp += allValue[i];
                }
            }
            firstNameTemp = firstNameTemp.Trim(); // To remove empty spaces
            lastNameTemp = lastNameTemp.Trim();   // To Remove Empty spaces
            //End splitter

            int assocIDTemp;    //TryParse succeeds
            bool assocIDparse;  //Bool for TryParse

            //Try Parsing Associate ID to an integer
            //Includes catch -> return
            assocIDparse = int.TryParse(textBoxAssocID.Text, out assocIDTemp);
            if (assocIDparse == false)
            {
                MessageBox.Show("Please use only numbers in the AssocID input");
                return;
            }
            var associateList = new List<Associate>();
            associateList.Add(new Associate
            {
                firstName = firstNameTemp,
                lastName = lastNameTemp,
                assocID = assocIDTemp,
                canDoDiverts = checkBoxDiverts.Checked,
                canDoMHE = checkBoxMHE.Checked,
                canDoLoading = checkBoxLoading.Checked,
            });
            textBoxAssocID.Clear();
            textBoxAssocName.Clear();
            textBoxRFID.Clear();
        }
    }
}

questionAnswers(2)

yourAnswerToTheQuestion