Hi Alvin
I am just learning this, I have a grid that has a
DataTable as the source.
I have created the following function:
private void itemcreated(object sender,
DataGridItemEventArgs e)
{
if(((DataRowView).e.Item.DataItem).ItemArray[5].ToString
() == "0")
{
e.Item.Cells[5].BackColor = System.Drawing.Color.Red;
}
}
I have then specified that the datagrid should use this
function when OnItemCreated is fired.
This gives me an access violation that I guess is due to
the fact that I have a DataTable as the source. I think
that I am on the right track since removing the if
statement colors the column red as I want.
TIA
-----Original Message-----
What you want is the BackColor property on the DataGrid object. It takes a
Color enum
Color.Red for example
regards
--
-----------
Got TidBits?
Get it here:
www.networkip.net/tidbits/default.htm
.