Ankit  Shukla

Ankit Shukla

  • NA
  • 681
  • 116.9k

Foreach loop in datagrid

Mar 9 2017 2:15 AM
Hello, I need to select  n-1 rows from datagrid and my code is:
 
foreach (DataGridViewRow row in dataGridView1.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
pdfTable.AddCell(cell.Value.ToString());
}
}
 
from where I should change to select all rows except last row..
 
Thanks in Advance. 

Answers (2)