/* remove column */ private void cbox_columnNames_SelectedIndexChanged(object sender, EventArgs e) { if (EssentialMethods.ConfirmSave("Are you sure you want to delete that table!", "CRITICAL")) { dgv_leads.Columns.Remove(cbox_columnNames.SelectedItem.ToString()); SetReminderCriteria(); } cbox_columnNames.Text = ""; rbtn_addColumn.Checked = true; }
private void btn_importLeads_Click(object sender, EventArgs e) { string filename = EssentialMethods.OpenFileDialogResult(EssentialMethods.Filters.CSV); Import_LeadsOnly(filename, dgv_leads); if (lbl_reminderCirteria.Text != REMINDER_NOTSET) { UpdateDailyTasks(lbl_reminderCirteria.Text); } }
private void ExportCSV(DataGridView dgv) { string filename = EssentialMethods.SaveFileDialogResult(EssentialMethods.Filters.CSV); if (filename != null && dgv != null) { //Save File.WriteAllText(filename, DatagridViewToCSV(dgv)); } }
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e) { if (lbl_reminderCirteria.Text == REMINDER_NOTSET) { if (EssentialMethods.ConfirmSave("The [ Reminder Criteria ] hasn't been set yet, Your Settings may be lost.\r\nAre You Sure You Want To Exit ?", "Confirm Exit")) { Export_DGV(PATH_SCHEMA, PATH_LEADS, dgv_leads); e.Cancel = false; } else { e.Cancel = true; } } }
private void ExportExcel(DataGridView dgv) { string file_name = EssentialMethods.SaveFileDialogResult(EssentialMethods.Filters.Excelfiles); if (file_name != null && dgv != null) { using (ExcelPackage package = new ExcelPackage(new FileInfo(file_name))) { ExcelWorksheet worksheet = package.Workbook.Worksheets.Add(Path.GetFileNameWithoutExtension(file_name)); worksheet.Cells["A1"].LoadFromText(DatagridViewToCSV(dgv), new ExcelTextFormat() { Delimiter = ',', EOL = "\r\n" }, OfficeOpenXml.Table.TableStyles.Medium27, true); package.Save(); } } }