Home Forums WPF controls Xceed DataGrid for WPF Conditional format for cells

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26058 |

    This is probably a brain-dead easy thing to do, but I’m not having any luck. All I want to do is format the foreground color of a cell to red if it’s value is negative. Can someone please help?

    Thanks!

    Imported from legacy forums. Posted by David (had 3334 views)

    Xceed Support
    Member
    Post count: 5658

    You can use the CellContentTemplate and CellContentTemplateSelector properties on a particular column, or you can create an implicit style that targets the DataCell type and that uses DataTriggers to change the desired property.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 249 views)

    User (Old forums)
    Member
    Post count: 23064

    Any chance I could get a code snippet? I tried creating a style to do it, but apparently I wasn’t referencing the right objects/properties.

    Imported from legacy forums. Posted by David (had 305 views)

    User (Old forums)
    Member
    Post count: 23064

    Any hope to get a code snippet? Again, I apologize if this is so trivial that it doesn’t seem worthy of a response, but if someone could help out it would help a lot.

    Thanks!

    Imported from legacy forums. Posted by David (had 470 views)

    Xceed Support
    Member
    Post count: 5658

    You can take a look at the ZodiacCellContentTemplateSelector class in the Custom Views sample (installed by the package) for an example.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 4239 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.