DATAGRIDVIEW - BackGround COLOR row

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Matt Matt 2 months, 3 weeks ago.

  • Author
    Posts
  • #69661
    Profile photo of Matt
    Matt
    Participant

    Hi

    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
    $row.Cells[0].value=$NAME_SERVER
    $row.Cells[1].value=$SERVER_ID
    $row.Cells[2].value=$MIN_SERVER
    $row.Cells[3].value=$MAX_SERVER
    $row.Cells[4].value=$SERVER_ID_MIN
    $row.Cells[5].value=$SERVER_ID_MAX

    # 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,

    Matt

  • #69664
    Profile photo of Max Kozlov
    Max Kozlov
    Participant
  • #69673
    Profile photo of Matt
    Matt
    Participant

    Hi,

    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.

    Matt

You must be logged in to reply to this topic.