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. Web Development
  3. ASP.NET
  4. Changing Background for Specific items in a DataGrid

Changing Background for Specific items in a DataGrid

Scheduled Pinned Locked Moved ASP.NET
helpquestionannouncement
3 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.
  • V Offline
    V Offline
    veroBT
    wrote on last edited by
    #1

    I have a datagrid that i populate with Invoices. I currently have the alternating item background color switching between silver and white. Now, i would like for the background to be Red for any Paid orders. How can my datagrid check whether the invoice has been paid or not? and then update the background color for just that row? All help is appreciated! Brian

    B J 2 Replies Last reply
    0
    • V veroBT

      I have a datagrid that i populate with Invoices. I currently have the alternating item background color switching between silver and white. Now, i would like for the background to be Red for any Paid orders. How can my datagrid check whether the invoice has been paid or not? and then update the background color for just that row? All help is appreciated! Brian

      B Offline
      B Offline
      Barry Etter
      wrote on last edited by
      #2

      Search for the ItemDataBound event... http://www.google.com/search?hl=en&ie=UTF-8&q=ItemDataBound&btnG=Google+Search[^] Barry Etter

      1 Reply Last reply
      0
      • V veroBT

        I have a datagrid that i populate with Invoices. I currently have the alternating item background color switching between silver and white. Now, i would like for the background to be Red for any Paid orders. How can my datagrid check whether the invoice has been paid or not? and then update the background color for just that row? All help is appreciated! Brian

        J Offline
        J Offline
        Jon G
        wrote on last edited by
        #3

        Easy stuff. Okay, once you find a row that needs to be colored, you can do the following: MYDATAGRID.Items(ROWNUMBER).BackColor = Color.Red Where: MYDATAGRID is the name of your datagrid ROWNUMBER is the integer value of the row to change Jon G www.Gizmocoder.com

        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