How to: Apply Conditional Formatting

  • 2 minutes to read

This example demonstrates how to change the appearance of individual cells based on specific conditions using the Conditional Formatting feature in markup.

The image below shows the result.


View Example

using System.ComponentModel.DataAnnotations;
using System.Linq;

namespace ConditionalFormatting {
    public class ConditionalFormattingViewModel {
        public ConditionalFormattingViewModel() {
            Items = SaleOverviewDataGenerator.GenerateSales();
        public SaleOverviewData[] Items { get; private set; }