int height = 300;
int i = 0;
while (i < PurchaseDepartDataGridView.Rows.Count)
{
height += PurchaseDepartDataGridView.Rows[0].Height;
e.Graphics.DrawString(PurchaseDepartDataGridView.Rows[i].Cells[0].FormattedValue.ToString(),PurchaseDepartDataGridView.Font,Brushes.Black, new Rectangle(25,height,PurchaseDepartDataGridView.Columns[0].Width,PurchaseDepartDataGridView.Rows[i].Height));
i++;
}
此代码无法正常运行。
我只想打印一行datagridview的值。