{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "datagrid-conditional-styling",
  "framework": "winui",
  "type": "registry:component",
  "component": "DataGrid",
  "variant": "conditional-styling",
  "dependencies": [
    "Syncfusion.Grid.WinUI"
  ],
  "description": "SfDataGrid with a CellStyleSelector applying red, yellow, violet, and green styles by sales value.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/winui/llms.txt",
    "skillPack": "syncfusion/winui-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/winui/datagrid-conditional-styling.md"
  },
  "files": [
    {
      "target": "src/components/datagrid-conditional-styling/DataGrid.xaml",
      "content": "﻿<Page\n    x:Class=\"DataGrid.Samples.ConditionalStyling.DataGrid\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"using:DataGrid\"\n    xmlns:dataGrid=\"using:Syncfusion.UI.Xaml.DataGrid\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    mc:Ignorable=\"d\">\n\n    <Grid x:Name=\"rootGrid\">\n        <Grid.Resources>\n            <local:SalesViewModel x:Key=\"salesViewModel\" />\n            <local:CustomCellStyleSelector x:Key=\"cellStyleSelector\" />\n\n            <Style x:Key=\"darkRedCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#f50602\"/>\n                <Setter Property=\"Foreground\" Value=\"White\"/>\n            </Style>\n            <Style x:Key=\"redCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#e37b64\"/>\n                <Setter Property=\"Foreground\" Value=\"Black\"/>\n            </Style>\n            <Style x:Key=\"lightRedCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#f07d9b\"/>\n                <Setter Property=\"Foreground\" Value=\"Black\"/>\n            </Style>\n            <Style x:Key=\"darkYellowCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#fcca03\"/>\n                <Setter Property=\"Foreground\" Value=\"White\"/>\n            </Style>\n            <Style x:Key=\"yellowCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#f0e090\"/>\n                <Setter Property=\"Foreground\" Value=\"Black\"/>\n            </Style>\n            <Style x:Key=\"lightYellowCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#f5e6b5\"/>\n                <Setter Property=\"Foreground\" Value=\"Black\"/>\n            </Style>\n            <Style x:Key=\"darkVioletCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#6f0e82\"/>\n                <Setter Property=\"Foreground\" Value=\"White\"/>\n            </Style>\n            <Style x:Key=\"violetCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#b464c4\"/>\n                <Setter Property=\"Foreground\" Value=\"Black\"/>\n            </Style>\n            <Style x:Key=\"lightVioletCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#e4b4ed\"/>\n                <Setter Property=\"Foreground\" Value=\"Black\"/>\n            </Style>\n            <Style x:Key=\"greenCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#50bf65\"/>\n                <Setter Property=\"Foreground\" Value=\"Black\"/>\n            </Style>\n            <Style x:Key=\"lightGreenCellStyle\" TargetType=\"dataGrid:GridCell\">\n                <Setter Property=\"Background\" Value=\"#99f2b4\"/>\n                <Setter Property=\"Foreground\" Value=\"Black\"/>\n            </Style>\n        </Grid.Resources>\n\n        <dataGrid:SfDataGrid\n            x:Name=\"sfDataGrid\"\n            Height=\"450\"\n            Width=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Center\"\n            AutoGenerateColumns=\"False\"\n            ColumnWidthMode=\"Auto\"\n            CellStyleSelector=\"{StaticResource cellStyleSelector}\"\n            DataContext=\"{StaticResource salesViewModel}\"\n            ItemsSource=\"{Binding YearlySales}\"\n            NavigationMode=\"Row\">\n\n            <dataGrid:SfDataGrid.Columns>\n                <dataGrid:GridTextColumn MappingName=\"Name\" />\n                <dataGrid:GridNumericColumn MappingName=\"QS1\" NumberFormatter=\"{Binding SystemCurrency,Source={StaticResource salesViewModel}}\" HeaderText=\"Sales in Q1\" TextAlignment=\"Right\" />\n                <dataGrid:GridNumericColumn MappingName=\"QS2\" NumberFormatter=\"{Binding SystemCurrency,Source={StaticResource salesViewModel}}\" HeaderText=\"Sales in Q2\" TextAlignment=\"Right\" />\n                <dataGrid:GridNumericColumn MappingName=\"QS3\" NumberFormatter=\"{Binding SystemCurrency,Source={StaticResource salesViewModel}}\" HeaderText=\"Sales in Q3\" TextAlignment=\"Right\" />\n                <dataGrid:GridNumericColumn MappingName=\"QS4\" NumberFormatter=\"{Binding SystemCurrency,Source={StaticResource salesViewModel}}\" HeaderText=\"Sales in Q4\" TextAlignment=\"Right\" />\n                <dataGrid:GridNumericColumn MappingName=\"Total\" NumberFormatter=\"{Binding SystemCurrency,Source={StaticResource salesViewModel}}\" HeaderText=\"Total Sales\" TextAlignment=\"Right\" />\n                <dataGrid:GridNumericColumn MappingName=\"Year\" HeaderText=\"Year\" TextAlignment=\"Right\" />\n            </dataGrid:SfDataGrid.Columns>\n        </dataGrid:SfDataGrid>\n    </Grid>\n</Page>"
    }
  ]
}