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. WPF
  4. Is it possible to dynamically change font color on a cell by cell basis on the same row?

Is it possible to dynamically change font color on a cell by cell basis on the same row?

Scheduled Pinned Locked Moved WPF
questioncsharpwpfhelp
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.
  • J Offline
    J Offline
    Jon_Boy
    wrote on last edited by
    #1

    I have a datagrid being populated from a datatable which contains several computed columns. If the computed cell value is >= to the previous day's value, I want the font color to stay the same. If the value is < than the previous day's value, I want to change the font for that particular cell red (not the entire row). Is that possible? In the WinForm datagridview it wasn't a big deal. I'm new to WPF and the datagrid, but am I missing something simple here to accomplish the same task? Thanks for any pointers or help.

    "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

    P 1 Reply Last reply
    0
    • J Jon_Boy

      I have a datagrid being populated from a datatable which contains several computed columns. If the computed cell value is >= to the previous day's value, I want the font color to stay the same. If the value is < than the previous day's value, I want to change the font for that particular cell red (not the entire row). Is that possible? In the WinForm datagridview it wasn't a big deal. I'm new to WPF and the datagrid, but am I missing something simple here to accomplish the same task? Thanks for any pointers or help.

      "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You should easily be able to accomplish this via DataTriggers.

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

      My blog | My articles | MoXAML PowerToys | Onyx

      J 1 Reply Last reply
      0
      • P Pete OHanlon

        You should easily be able to accomplish this via DataTriggers.

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

        My blog | My articles | MoXAML PowerToys | Onyx

        J Offline
        J Offline
        Jon_Boy
        wrote on last edited by
        #3

        Roger that gold leader. Let me go looking into datatriggers. Thanks!

        "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

        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