0

i'm developing an Accounting Program. You all know about "type of ledger" in Accounting and when i viewed all my ledger in a datagrid, i added the ledger classification.
This started confusing me how to coloring the rows which show the ledger different with the row Color which show the classification.

I used to call DataGridTableStyles and use the property "BackColor" but we know it colors only the odd-numbered rows. I had hard seeking suitable methods and properties and finally conclude myself that perhaps it means unavailable. Anyone please help me solve this with tells the methods or even the code if there's no method available ..

example:
Row Color
1 Red
2 Green
3 Blue
4 Blue
5 Green
6 Blue
7 Red
8 Green
etc

thanks and regards

Vincentius Owen

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by ProfessorPC
0

try this

Use the "Style" property -

DataGridView1.Item(ColumnIndex, RowIndex).Style.BackColor = Color
DataGridView1.Item(ColumnIndex, RowIndex).Style.ForeColor = Color

or

DataGridView1.CurrentCell.Style.BackColor = Color
DataGridView1.CurrentCell.Style.ForeColor = Color
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.