Results 1 to 5 of 5

Thread: DataGridview specific cell back color

  1. #1
    flashkid10 is offline C# Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2016
    Posts
    16
    Rep Power
    6

    DataGridview specific cell back color

    I have a DadtaGridview that hold the name of events happening every day of the week (7 columens), and each of them has a different status which corresponds to a color. how do i set a specific backcolor or border of a specific cell?

  2. #2
    JohnH's Avatar
    JohnH is offline C# Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Apr 2011
    Location
    Norway
    Posts
    331
    Rep Power
    87

  3. #3
    flashkid10 is offline C# Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2016
    Posts
    16
    Rep Power
    6
    I don't think i understand, i'm doing what it says and it is instead applying the backcolor to the entire datagrid

  4. #4
    JohnH's Avatar
    JohnH is offline C# Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Apr 2011
    Location
    Norway
    Posts
    331
    Rep Power
    87
    The event is called one time for each cell in grid "every time each cell is painted". You decide based on ColumnIndex/RowIndex and/or cell value which BackColor to apply to each cell.

  5. #5
    flashkid10 is offline C# Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2016
    Posts
    16
    Rep Power
    6
    Okay, thank you, its now working

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •