Author Posts

April 27, 2017 at 9:56 am


Excuse me for my english.

I have wrote a script where i charge a file with data in a DATAGRIDVIEW.

Next when i modify some data in the DATAGRIDVIEW i click on a button "GENERATE" for modify somme value.

foreach ($row in $datagridview.Rows)
# Traitement
# ...
# ...

# Update Value

# CHange color of the current row modify
$row.DefaultCellStyle.BackColor = 'cyan'

At the end i change the color of the row i some value has modify.

Until this, it's OK.

But when i have some row with a background color cyan and i click on the title of a column for order, the color disapear.....
All the background are white.

Can you explain to me and the solution to keep the colour backupground cyan even if I order on a column?

Thanks for your help,


April 27, 2017 at 11:25 am


Thanks for your reply.

I have change by :
$row.DefaultCellStyle.SelectionBackColor = 'cyan'

But it's the same when i click on a column to order the datagrid the color disapear.