I think you guys may be confusing DataGridViewRows with DataRows. Datatables don't store formatting information because they aren't directly displayed. You need to set the background colour of the DataGridView's Row.
I'd suggest looking at the CellFormatting event as it is only called against cells that are to be displayed. If you have a datagridview thats big enough to display ten rows at a time but has 100's or 1000's of rows in it then you only want to change the appearance of rows that are currently visible; looping through every single row could cause your program to freeze momentarily.
In the CellFormatting event, check the value of the status column and set the row's .DefaultCellStyle.BackColor property accordingly:
The link you referenced is about polymorphism, the draw methods are just used to highlight how child classes can alter the behaviour of their parent class. It has no relevance to what the OP needs or what OTS said.
Yes that is true,but I was trying to highlight the problem with "foreach" statement. :)
public static int Main( )
DrawingObject dObj = new DrawingObject;
dObj = new Line();
dObj = new Circle();
dObj = new Square();
dObj = new DrawingObject();
foreach (DrawingObject drawObj in dObj)//This statement.......
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...