private void OnDeleteClass(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure? This will also delete the categories inside this class.", "Delete class", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         if (ClassList.Count == 1)
         {
             ClearTotals();
             ClearGrade();
             groupBoxTotals.Text  = "Class Grade";
             groupBoxGrade.Text   = "Category Totals (%)";
             dataGridView.Enabled = false;
             dataGridView.Rows.Clear();
             comboBoxCategory.Enabled = false;
             comboBoxClass.Items.Remove(CurrentClass.Name);
             comboBoxCategory.Items.Clear();
             comboBoxCategory.Items.Add("Create new category");
             ClassList.Remove(CurrentClass);
             editClassToolStripMenuItem.Enabled      = false;
             deleteClassToolStripMenuItem.Enabled    = false;
             addCategoryToolStripMenu.Enabled        = false;
             editCategoryToolStripMenuItem.Enabled   = false;
             deleteCategoryToolStripMenuItem.Enabled = false;
             saveAsToolStripMenuItem.Enabled         = false;
             saveToolStripMenuItem.Enabled           = false;
         }
         else
         {
             comboBoxClass.Items.Remove(CurrentClass.Name);
             if (CurrentClassIndex != 0)
             {
                 --CurrentClassIndex;
             }
             comboBoxClass.SelectedIndex = CurrentClassIndex + 1;
             if (CurrentClass.CategoryList.Count != 0)
             {
                 UpdateTotals();
                 UpdateGrade();
                 LoadData();
             }
             else
             {
                 ClearTotals();
                 ClearGrade();
             }
             groupBoxGrade.Text  = CurrentClass.Name + " Grade";
             groupBoxTotals.Text = "Category Totals (%)";
             ClassList.RemoveAt(CurrentClassIndex + 1);
             dataGridView.Rows.Clear();
             dataGridView.Enabled = false;
             comboBoxCategory.Items.Clear();
             comboBoxCategory.Items.Add("Create new category");
             foreach (Category c in CurrentClass.CategoryList)
             {
                 comboBoxCategory.Items.Add(c.Name);
             }
         }
     }
 }