Ejemplo n.º 1
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            SaveFileDialog sf = new SaveFileDialog();

            sf.Filter           = "Excel Filles(*,xls)|*.xls";
            sf.CheckFileExists  = false;
            sf.CheckPathExists  = false;
            sf.FilterIndex      = 0;
            sf.RestoreDirectory = true;
            sf.CreatePrompt     = true;
            if (sf.ShowDialog() == DialogResult.OK)
            {
                Stream savestr = sf.OpenFile();
                DataGridViewHelper.DataGridViewToExcel(dgvBook, savestr);
            }
        }