Dynamically change Row.ForeColor
-
Hi I work with Framework 2.0 (c#). I do not know how to dynamicaly change ForeColor of a row in DataGridView depending on value of one column in grid which changes dynamically too. When I tried to use DataGridView.CellFormatting event only cell where the value is changed has the right forecolor. However other have the old one. After selecting and deselecting other cells in the row they have right color. AlternatingStyle is not good because there are more than two kind of colors. Which event do I have to use and which method call in order to refresh a whole row? Before (in Framework 1.1) I did it by creating columns inheriting from my own class where method paint was overriden. However I would like to use new features in F 2.0. Thanks Ela
-
Hi I work with Framework 2.0 (c#). I do not know how to dynamicaly change ForeColor of a row in DataGridView depending on value of one column in grid which changes dynamically too. When I tried to use DataGridView.CellFormatting event only cell where the value is changed has the right forecolor. However other have the old one. After selecting and deselecting other cells in the row they have right color. AlternatingStyle is not good because there are more than two kind of colors. Which event do I have to use and which method call in order to refresh a whole row? Before (in Framework 1.1) I did it by creating columns inheriting from my own class where method paint was overriden. However I would like to use new features in F 2.0. Thanks Ela
e_LA wrote:
When I tried to use DataGridView.CellFormatting event only cell where the value is changed has the right forecolor
I think you're close. You can get the rowindex from this event and change the cells in the row.
only two letters away from being an asset
-
e_LA wrote:
When I tried to use DataGridView.CellFormatting event only cell where the value is changed has the right forecolor
I think you're close. You can get the rowindex from this event and change the cells in the row.
only two letters away from being an asset
-
e_LA wrote:
When I tried to use DataGridView.CellFormatting event only cell where the value is changed has the right forecolor
I think you're close. You can get the rowindex from this event and change the cells in the row.
only two letters away from being an asset
-
e_LA wrote:
When I tried to use DataGridView.CellFormatting event only cell where the value is changed has the right forecolor
I think you're close. You can get the rowindex from this event and change the cells in the row.
only two letters away from being an asset
-
It doesn't work if I stay in the same row (I do not change the row) - for example by pressing TAB not ENTER. I think I should return to the previous version with overriding Paint event in custom type column :-(
I don't understand what you are trying to do and what you are doing. Maybe a code snippet would be helpful. Once you change the color of a cell it doesn't matter what else you do.
only two letters away from being an asset