コード例 #1
0
 private void ShowData_Click(object sender, EventArgs e)
 {
     ExcelData.Rows.Add(DateTime.Now.ToString("MM-dd-yyyy"), txt_Gvalue.Text, label_rect.Text, FileNameLabel.Text, FilePathLabel.Text);
     AddDataButton.Enabled = false;
     ExcelButton.Enabled   = true;
     ExcelData.ClearSelection();
     image_Original.Image.Dispose();
 }
コード例 #2
0
        private void DeleteRowButton_Click(object sender, EventArgs e)
        {
            if (ExcelData.SelectedCells.Count == 0)
            {
                MessageBox.Show("Please select any cell in the row(s) you wish to delete first");
            }

            else if (ExcelData.SelectedCells.Count > 0)
            {
                foreach (DataGridViewCell oneCell in ExcelData.SelectedCells)
                {
                    if (oneCell.Selected)
                    {
                        ExcelData.Rows.RemoveAt(oneCell.RowIndex);
                    }
                }
            }
            ExcelData.Refresh();
            ExcelData.ClearSelection();
        }