To do this, you'll need to listen to the FormatCell event. This code colours
the "Cooking Skill" cells depending on the value in the cell.
this.olvSimple.UseCellFormatEvents=true;this.olvSimple.FormatCell+=(sender,args)=>{// Only for the columns you wantif(args.Column.Text!="Cooking Skill")return;if(!(args.CellValueisint))return;switch((int)args.CellValue){case1:args.SubItem.BackColor=Color.Aquamarine;break;case30:args.SubItem.BackColor=Color.GreenYellow;break;}};
Regards,
Phillip
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good afternoon,
It's being complicated to solve the problem that i am facing.
I have a ObjectListView filled and need to distinguish the rows that have a
specific value in a cell.
So, if the cell as a value of 1 -> yellow row, value of 2 -> orange row, and
so on..
I used the default ObjectListView control provided, no code used.
What is the best way to do that?
Thank you!
To do this, you'll need to listen to the FormatCell event. This code colours
the "Cooking Skill" cells depending on the value in the cell.
Regards,
Phillip