C# code:
ExcelFile ef = new ExcelFile();
DataTable dataTable = (DataTable)dataGrid1.DataSource;
// Depending on the format of the input file, you need to change this:
dataTable.Columns.Add("FirstName", typeof(string));
dataTable.Columns.Add("LastName", typeof(string));
// Load Excel file.
ef.LoadXls("FileName.xls");
// Select the first worksheet from the file.
ExcelWorksheet ws = ef.Worksheets[0];
// Extract the data from the worksheet to the DataTable (DataGrid).
// Data is extracted starting at first row and first column for 10 rows or until the first empty row appears.
ws.ExtractToDataTable(dataTable, 10, ExtractDataOptions.StopAtFirstEmptyRow, ws.Rows[0], ws.Columns[0]);
// Change the value of the first cell in the DataTable (DataGrid).
dataTable.Rows[0][0] = "Hello world!";
// Insert the data from DataTable to the worksheet starting at cell "A1".
ws.InsertDataTable(dataTable, "A1", true);
// Save the file to XLS format.
ef.SaveXls("DataGrid.xls");