c# - Update DatagridView Cell Background color based on row data -
Hello I have got a datagrid view and I would like to change the color of the background based on the data in each row.
East.
| Person 1 Person 2 Person 3
| ---- 100 ---- --- --- 200 ----- | ----- 150 ---- |
| ---- 300 ---- --- --- 100 ----- | ------ 50 ---- |
In the first line, I have a red background color of "100" and "200" green. Lowest value = red highest = green
Now the point is that Im is using a binding list for my data, and its update is being updated with InynifyPropertyChanged. So I need to check each time to update one of the values.
Is there a such event in Datagram that will be useful? Subdivision DataGride View and Overlays Onself Formatting (), here you can inspect the cell value and change the color to Can properly set up
This event, yes you can do this, but better performance and sub-clasing datagrid view in virtual method captures all the behavior of your grid in one place.
Comments
Post a Comment