hi
i'm using a datagrid view control which get's his datasource from a dataset control.
my code is:
dataGrid = new DataGridView();
dataGrid.DataSource = dataSet.Tables["Vertexes"];
this.Controls.Add(dataGrid);
the datagridview in shown fine.
the problem is that when i try to cahnge cells color like this:
for (int x = 0; x < dataGrid.Rows.Count; x++)
{
for (int y = 0; y < dataGrid.Rows[x].Cells.Count; y++)
{
if (x == y)
{
dataGrid.Rows[x].Cells[y].Style.BackColor =
System.Drawing.Color.Red;
}
}
}
it doest eners to the 'for' loop. i can see in debug that the datagridvew rows and columns controls are empty.