Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. coloring the row after pressing a button

coloring the row after pressing a button

Scheduled Pinned Locked Moved C#
helpdatabasetutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    salemmohamed
    wrote on last edited by
    #1

    Greetings all, I am facing a problem in my project. I created a button that should color the whole row to a red when cloumn " called status" is equal to "open". As an example: when column "status" of that row is "OPEN" then the whole row will be red. When column "status" of that row is "STOP" then the whhole row will be green. and etc depending on the condition. that will be checked in the whole database. Thank you for your help and regards,

    L 1 Reply Last reply
    0
    • S salemmohamed

      Greetings all, I am facing a problem in my project. I created a button that should color the whole row to a red when cloumn " called status" is equal to "open". As an example: when column "status" of that row is "OPEN" then the whole row will be red. When column "status" of that row is "STOP" then the whhole row will be green. and etc depending on the condition. that will be checked in the whole database. Thank you for your help and regards,

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      What control are you using ? DataGridView ? then:

      foreach(DataGridViewRow row in dataGridView.Rows)
      {
      foreach(DataGridViewCell cell in row.Cells)
      {
      cell.Style.BackColor = Color.Red;
      }
      }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups