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
  1. Home
  2. General Programming
  3. C#
  4. datagridview row back color

datagridview row back color

Scheduled Pinned Locked Moved C#
visual-studiohelp
3 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.
  • P Offline
    P Offline
    prubyholl
    wrote on last edited by
    #1

    foreach (DataGridViewRow dr in dgproducts.Rows) { if (Convert.ToInt32(dr.Cells[9].Value) < Convert.ToInt32(dr.Cells[6].Value)) { ## //i need to color this row here } } ## i need to colour the particular row at that point of the loop i cant find anything like in that intellisense and sub-intellisense maybe am not checking well. any help plz

    D 1 Reply Last reply
    0
    • P prubyholl

      foreach (DataGridViewRow dr in dgproducts.Rows) { if (Convert.ToInt32(dr.Cells[9].Value) < Convert.ToInt32(dr.Cells[6].Value)) { ## //i need to color this row here } } ## i need to colour the particular row at that point of the loop i cant find anything like in that intellisense and sub-intellisense maybe am not checking well. any help plz

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      DataGridView.Rows.DefaultCellStyle.BackColor will do that.

      It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

      P 1 Reply Last reply
      0
      • D dan sh

        DataGridView.Rows.DefaultCellStyle.BackColor will do that.

        It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

        P Offline
        P Offline
        prubyholl
        wrote on last edited by
        #3

        Thanks am trying it out.. thanks a mill

        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