المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : how to see datagrid print printpriview in c# windows.



C# Programming
09-18-2009, 02:21 AM
i written following code under printDocument1_PrintPage event


Font f = new Font("Arial", 14, FontStyle.Regular);
Brush b = Brushes.Black;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
for (int j = 0; j < dataGridView1.Columns.Count; j++)
{
e.Graphics.DrawString(this.dataGridView1(i, j) + " ", f, b, j * 5, i * 5);
}
}

i am getting error this.dataGridView1(i, j)
error message isError 1 Non-invocable member FormsApplication2.Form1.dataGridView1' cannot be used like a method.
please help me .