I have radgridview with data written in design time i.e, code
this.radGridView1.Rows.Add("Jjkh", 19, 2, 9, 12, 21,52, 44, 63,56, System.DateTime.Now);
this.radGridView1.Rows.Add("Jjkh", 10, 2, 9, 12, 21, 52, 44, 63, 87, System.DateTime.Now);
this.radGridView1.Rows.Add("eur", 16, 2, 9, 12, 21, 52, 44, 63, 34, System.DateTime.Now);
this.radGridView1.Rows.Add("usd", 14, 2, 9, 12, 21, 52, 44, 63, 23, System.DateTime.Now);
this.radGridView1.Rows.Add("Jjkh", 67, 81, 33, 4, 55, 66, 7, 7, 11, System.DateTime.Now);
After this i've written code for forecolor:
for (int i = 0; i < radGridView1.Rows.Count; i++)
{
for (int j = 1; j < 4; j++)
this.radGridView1.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.White;
this.radGridView1.Rows[i].Cells[4].Style.ForeColor = System.Drawing.Color.Blue;
this.radGridView1.Rows[i].Cells[5].Style.ForeColor = System.Drawing.Color.Red;
}
But for back color, i've written in radGridView1_CellFormatting,
e.CellElement.BackColor = Color.Blue;
But the event radGridView1_CellFormatting is not binding with any method..
this.radGridView1.Rows.Add("Jjkh", 19, 2, 9, 12, 21,52, 44, 63,56, System.DateTime.Now);
this.radGridView1.Rows.Add("Jjkh", 10, 2, 9, 12, 21, 52, 44, 63, 87, System.DateTime.Now);
this.radGridView1.Rows.Add("eur", 16, 2, 9, 12, 21, 52, 44, 63, 34, System.DateTime.Now);
this.radGridView1.Rows.Add("usd", 14, 2, 9, 12, 21, 52, 44, 63, 23, System.DateTime.Now);
this.radGridView1.Rows.Add("Jjkh", 67, 81, 33, 4, 55, 66, 7, 7, 11, System.DateTime.Now);
After this i've written code for forecolor:
for (int i = 0; i < radGridView1.Rows.Count; i++)
{
for (int j = 1; j < 4; j++)
this.radGridView1.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.White;
this.radGridView1.Rows[i].Cells[4].Style.ForeColor = System.Drawing.Color.Blue;
this.radGridView1.Rows[i].Cells[5].Style.ForeColor = System.Drawing.Color.Red;
}
But for back color, i've written in radGridView1_CellFormatting,
e.CellElement.BackColor = Color.Blue;
But the event radGridView1_CellFormatting is not binding with any method..