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. Visual Basic
  4. Setting the Datagrid Row Backcolor for Selected rows

Setting the Datagrid Row Backcolor for Selected rows

Scheduled Pinned Locked Moved Visual Basic
helpquestion
4 Posts 3 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
    prathiba_naresh
    wrote on last edited by
    #1

    Hi All, I have a requirement for shading the backcolor of certain rows of the Datagrid. Lets assume my table has 4 rows in it. I want to display the alternate rows in different colours and if two consecutive rows is grouped for some reason they need to show the same color. (Can't Use Datagrid's Alternatebackcolor and backcolor). Case 1 Row 1 & 3 backcolor as Pale green Row 2 & 4 backcolor as Dark green ( Easy with the above said properties) Case 2 Row 1 backcolor as Pale green Rows 2 & 3 backcolor as Dark green Row 4 backcolor as Pale green Tried loads of samples but can't achieve these 2 cases with any of them. can someone help ? Thanks

    T P 2 Replies Last reply
    0
    • P prathiba_naresh

      Hi All, I have a requirement for shading the backcolor of certain rows of the Datagrid. Lets assume my table has 4 rows in it. I want to display the alternate rows in different colours and if two consecutive rows is grouped for some reason they need to show the same color. (Can't Use Datagrid's Alternatebackcolor and backcolor). Case 1 Row 1 & 3 backcolor as Pale green Row 2 & 4 backcolor as Dark green ( Easy with the above said properties) Case 2 Row 1 backcolor as Pale green Rows 2 & 3 backcolor as Dark green Row 4 backcolor as Pale green Tried loads of samples but can't achieve these 2 cases with any of them. can someone help ? Thanks

      T Offline
      T Offline
      thealca
      wrote on last edited by
      #2

      there is no way that u can do it in DataGrid as far as i know. . . u can try MS FlexGrid

      1 Reply Last reply
      0
      • P prathiba_naresh

        Hi All, I have a requirement for shading the backcolor of certain rows of the Datagrid. Lets assume my table has 4 rows in it. I want to display the alternate rows in different colours and if two consecutive rows is grouped for some reason they need to show the same color. (Can't Use Datagrid's Alternatebackcolor and backcolor). Case 1 Row 1 & 3 backcolor as Pale green Row 2 & 4 backcolor as Dark green ( Easy with the above said properties) Case 2 Row 1 backcolor as Pale green Rows 2 & 3 backcolor as Dark green Row 4 backcolor as Pale green Tried loads of samples but can't achieve these 2 cases with any of them. can someone help ? Thanks

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

        enumrate the cells in the whole row and color the cells as you go: http://www.syncfusion.com/faq/winforms/search/745.asp[^] hope this helps.

        P 1 Reply Last reply
        0
        • P progload

          enumrate the cells in the whole row and color the cells as you go: http://www.syncfusion.com/faq/winforms/search/745.asp[^] hope this helps.

          P Offline
          P Offline
          prathiba_naresh
          wrote on last edited by
          #4

          I Tried this sample yesterday and this doesn't solve my first case wherein i have to display alternate colors for each layer. Anyway thanks for your help.

          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