Here is how you can achieve the desired LINQ conversion:
Conversion for your first code snippet of foreach construct -
GrdJobno.HeaderRow.Cells.OfType<TableCell>().ToList<TableCell>().ForEach(cell => {
if (cell.Text != " ")
dtCustomers.Columns.Add(cell.Text);
});
In your second code snippet there is an outer foreach loop and an inner for loop. You have asked for conversion of for loop into a LINQ query which is technically not possible. At best you can convert the outer foreach construct into a LINQ query. Here is how:
GrdJobno.Rows.OfType<GridViewRow>().ToList<GridViewRow>().ForEach(
row =>
{
dtCustomers.Rows.Add();
for (int i = 1; i < row.Cells.Count; i++)
{
dtCustomers.Rows[row.RowIndex][i - 1] = row.Cells[i].Text.Replace(" ", "");
}
});