I m getting error in this statement in the following code:
((DataTable)wddgv.DataSource).Rows[i + row];
private
void DrawGridBody(Graphics g, int y_value)
{
int x_value;
for (int i = 0; i < 5; ++i)
{
DataRow dr =
((
DataTable)wddgv.DataSource).Rows[i + row];
x_value = 0;
// draw a solid line
g.DrawLine(
Pens.Black, new Point(0, y_value),
new Point(this.Width, y_value));
foreach (DataGridViewColumn dc in wddgv.Columns)
{
string text = dr[dc.DataPropertyName].ToString();
g.DrawString(text,
this.Font, Brushes.Black,
(
float)x_value, (float)y_value + 10f);
x_value += dc.Width + 5;
}
y_value += 40;
}
row += 5;
}
Sreejesh SPPosted Mar 4, 2013, 12:12 AM
Your For loop is problem,that means,this datatble inlude only two rows that index is 0 and 1 so please change your for loop condition,my decision is
for(int i=0;i
thanks
sreejesh