private void Redo_Click(object sender, EventArgs e)
{
spreadsheet1.Redo();
spreadsheet1.Refresh();
}
private void Undo_Click(object sender, EventArgs e)
{
spreadsheet1.Undo();
spreadsheet1.Refresh();
}
private void btnLoadFile_Click(object sender, EventArgs e)
{
OpenFileDialog ofDialog = new OpenFileDialog();
ofDialog.Filter = "Microsoft Excel files(*.xls)|*.xls;*.xlsx;*.xlsb;*.ods";
if (ofDialog.ShowDialog() == DialogResult.OK)
{
OpenFile(ofDialog.FileName);
}
spreadsheet1.EnableUndo = true;
}
private void OpenFile(string fileName)
{
if (fileName != null)
spreadsheet1.LoadFromFile(fileName);
}
private void DelRow_Click(object sender, EventArgs e)
{
spreadsheet1.ActiveWorksheet.RemoveRow(spreadsheet1.ActiveWorksheet.GetSelectedRange().Top);
}
private void DelCol_Click_1(object sender, EventArgs e)
{
spreadsheet1.ActiveWorksheet.RemoveColumn(spreadsheet1.ActiveWorksheet.GetSelectedRange().Right);
}
}