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. WinForm VS2003 DataGrid column / row / cell colors

WinForm VS2003 DataGrid column / row / cell colors

Scheduled Pinned Locked Moved C#
csharpwinformsquestion
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
    spin vector
    wrote on last edited by
    #1

    Hi, this is a repost from earlier. Using WinForms in VS2003 and a DataGrid, how do I control the *color* for individual columns / rows / cells. I don't see any properties in DataGrid, DataTable, DataView, or DataGridTableStyle. Thanks.

    R 1 Reply Last reply
    0
    • S spin vector

      Hi, this is a repost from earlier. Using WinForms in VS2003 and a DataGrid, how do I control the *color* for individual columns / rows / cells. I don't see any properties in DataGrid, DataTable, DataView, or DataGridTableStyle. Thanks.

      R Offline
      R Offline
      Ryomin
      wrote on last edited by
      #2

      Is this what you're looking for? DataGrid grid = new DataGrid(); //First Row BackColor grid.Items[0].BackColor = Color.Red; //First Row First Cell grid.Items[0].Cells[0].BackColor = Color.Green; As for changing the column's color I think you need to loop though each row for a particular cell and change the color that way... I'm not really sure if there is a better way to do it. e.g. //Change Column color for first cell foreach(DataRow row in grid.Rows) { row.Cells[0].BackColor = Color.Blue; }

      Cheers Disgyza Programmer Analyst

      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