Skip to main content

Problem:

In a DataGridView object from the .Net Framework V2 and above. How can you change the background colour of "row" programatically?

Resolution:

You can use the "DefaultCellStyle" on the row to acheive this:-

set datagridview1::"Rows"::"Item"(ls-count)::"DefaultCellStyle"::"BackColor" to cColor::"LimeGreen"

This sets the background colour to Lime Green.

Old KB# 3922