private void ContactForm_Load(object sender, EventArgs e)
        {
            allData.Clear();

            using (CustomerDataModel db = new CustomerDataModel())
            {
                DbSet <Customer> customers = db.Customers;

                foreach (Customer customer in customers)
                {
                    allData.Add(maxIndex, customer);
                    maxIndex++;
                }
            }
            UpdateData(currentIndex);
        }
        private void buttonImport_Click(object sender, EventArgs e)
        {
            String file = textImportFile.Text;

            using (TextFieldParser parser = new TextFieldParser(file))
            {
                bool removeHeader = false;
                parser.Delimiters = new string[] { "," };
                while (true)
                {
                    string[] parts = parser.ReadFields();
                    if (parts == null)
                    {
                        break;
                    }

                    // removeHeader removes the header in CSV file and displays only data in FORM (Row1)
                    if (removeHeader)
                    {
                        using (CustomerDataModel db = new CustomerDataModel())
                        {
                            DbSet <Customer> customers = db.Customers;
                            Customer         cust      = new Customer();
                            cust.FirstName    = parts[0];
                            cust.LastName     = parts[1];
                            cust.StreetNumber = parts[2];
                            cust.Address      = parts[3];
                            cust.City         = parts[4];
                            cust.Province     = parts[5];
                            cust.Country      = parts[6];
                            cust.PostalCode   = parts[7];
                            cust.PhoneNumber  = parts[8];
                            cust.EmailAddress = parts[9];

                            // this saves it in the DB to be saved when Save is called
                            customers.Add(cust);
                            db.SaveChanges();
                            allData.Add(maxIndex, cust);
                            maxIndex++;
                        }
                    }
                    removeHeader = true;
                }
            }
            UpdateData(currentIndex);
        }