I would suggest add a button, click and export the selected row.
private void btnExport_Click(object sender, EventArgs e)
{
if (myDataGridView.SelectedRows.Count != 0)
{
Microsoft.Office.Interop.Excel._Application app = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel._Workbook workbook = app.Workbooks.Add(Type.Missing);
Microsoft.Office.Interop.Excel._Worksheet worksheet = null;
worksheet = workbook.Sheets["Sheet1"];
worksheet = workbook.ActiveSheet;
worksheet.Name = "Exported from gridview";
DataGridViewRow row = this.myDataGridView.SelectedRows[0];
for (int i = 1; i < myDataGridView.Columns.Count + 1; i++)
{
worksheet.Cells[1, i] = myDataGridView.Columns[i - 1].HeaderText;
}
int rowIndex = 2;
foreach (DataGridViewRow r in myDataGridView.SelectedRows)
{
for (int j = 0; j < r.Cells.Count; j++)
{
worksheet.Cells[rowIndex, j + 1] = r.Cells[j].Value.ToString();
}
rowIndex++;
}
workbook.SaveAs("c:\\temp\\output.xls", Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive,
Type.Missing, Type.Missing, Type.Missing, Type.Missing);
app.Quit();
}