Show gridview rows in a different colour
iam displaying records in gridview,now my requirement is based on the transaction i want to show that rows in a different colour
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Lalit MPosted Nov 15, 2009, 11:52 PM
Lalit MPosted Nov 15, 2009, 11:40 PM
Nilanka DharmadasaPosted Nov 15, 2009, 11:36 PM
Use datagridview's CellPainting method to do that.
Let's say you want to check the value of 'Column2' and color your rows based on the value of that column.
So. you can write code as below.
If you find this answer useful, do not forgrt to mark this as accepted.