{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-conditional-formatting",
  "framework": "aspnet-core",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "conditional-formatting",
  "dependencies": [
    "Syncfusion.AspNetCore.Spreadsheet"
  ],
  "description": "Spreadsheet editor with conditional formatting rules applied to data ranges.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 2 (v34.1.29)",
    "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/aspnet-core/llms.txt",
    "skillPack": "syncfusion/aspnetcore-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/aspnet-core/spreadsheet-editor-conditional-formatting.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-conditional-formatting/spreadsheet-editor.cshtml",
      "content": "@using Syncfusion.EJ2\r\n\r\n    <div class=\"control-section\">\r\n        <ejs-spreadsheet id=\"spreadsheet\" openUrl=\"ConditionalFormatOpen\" saveUrl=\"ConditionalFormatSave\" created=\"createdHandler\">\r\n            <e-spreadsheet-sheets>\r\n                <e-spreadsheet-sheet name=\"Inventory List\">\r\n                    <e-spreadsheet-rows>\r\n                        <e-spreadsheet-row height=30>\r\n                            <e-spreadsheet-cells>\r\n                                <e-spreadsheet-cell index=1 value=\"Inventory List\"></e-spreadsheet-cell>\r\n                            </e-spreadsheet-cells>\r\n                        </e-spreadsheet-row>\r\n                    </e-spreadsheet-rows>\r\n                    <e-spreadsheet-ranges>\r\n                        <e-spreadsheet-range dataSource=\"@ViewData[\"ConditionalFormattingData\"]\" startCell=\"A2\"></e-spreadsheet-range>\r\n                    </e-spreadsheet-ranges>\r\n                    <e-spreadsheet-conditionalformats>\r\n                        <e-spreadsheet-conditionalformat type=\"GYRColorScale\" range=\"C3:C18\"></e-spreadsheet-conditionalformat>\r\n                        <e-spreadsheet-conditionalformat type=\"LessThan\" cFColor=\"RedFT\" value=\"8-8-2019\" range=\"G3:G18\"></e-spreadsheet-conditionalformat>\r\n                    </e-spreadsheet-conditionalformats>\r\n\t\t\t\t\t<e-spreadsheet-columns>\r\n\t\t\t\t\t\t<e-spreadsheet-column width=\"100\"></e-spreadsheet-column>\r\n\t\t\t\t\t\t<e-spreadsheet-column width=\"158\"></e-spreadsheet-column>\r\n\t\t\t\t\t\t<e-spreadsheet-column width=\"72\"></e-spreadsheet-column>\r\n\t\t\t\t\t\t<e-spreadsheet-column width=\"113\"></e-spreadsheet-column>\r\n\t\t\t\t\t\t<e-spreadsheet-column width=\"113\"></e-spreadsheet-column>\r\n\t\t\t\t\t\t<e-spreadsheet-column width=\"77\"></e-spreadsheet-column>\r\n\t\t\t\t\t\t<e-spreadsheet-column width=\"97\"></e-spreadsheet-column>\r\n\t\t\t\t\t\t<e-spreadsheet-column width=\"73\"></e-spreadsheet-column>\r\n\t\t\t\t\t</e-spreadsheet-columns>\r\n                </e-spreadsheet-sheet>\r\n            </e-spreadsheet-sheets>\r\n        </ejs-spreadsheet>\r\n    </div>\r\n\r\n<script>\r\n    function createdHandler() {\r\n        var excelObj = this;\r\n        excelObj.merge('A1:H1');\r\n        excelObj.cellFormat({ fontWeight: 'bold', textAlign: 'center' }, 'A2:H2');\r\n        excelObj.cellFormat({ fontWeight: 'bold', textAlign: 'center', verticalAlign: 'middle', fontSize: '13pt' }, 'A1:H1');\r\n\t\texcelObj.numberFormat('$#,##0.00', 'D3:F18');\r\n        excelObj.numberFormat('m/d/yyyy', 'G3:G18');\r\n        excelObj.conditionalFormat({ type: 'BlueDataBar', range: 'D3:D18' });\r\n\t\texcelObj.conditionalFormat({ type: 'GreenDataBar', range: 'E3:E18' });\r\n        excelObj.conditionalFormat({ type: 'ThreeStars', range: 'H3:H18' });\r\n\t\texcelObj.conditionalFormat({ type: \"Top10Items\", value: '1', format: { style: { color: '#ffffff', backgroundColor: '#009999',\r\n            fontWeight: 'bold' } }, range: 'F3:F18' });\r\n\t\texcelObj.conditionalFormat({ type: \"Bottom10Items\", value: '1', format: { style: { color: '#ffffff', backgroundColor: '#c68d53',\r\n            fontWeight: 'bold' } }, range: 'F3:F18' });\r\n    }\r\n</script>"
    },
    {
      "target": "src/components/spreadsheet-editor-conditional-formatting/spreadsheet-editor.cshtml.cs",
      "content": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.AspNetCore.Http;\r\nusing Syncfusion.EJ2.Spreadsheet;\r\n\r\nnamespace EJ2CoreSampleBrowser.Controllers\r\n{\r\n    public partial class SpreadsheetController : Controller\r\n    {\r\n        public IActionResult ConditionalFormatting()\r\n        {\r\n            List<object> data = new List<object>()\r\n            {\r\n                new { ItemCode=\"AG940Z\",  ItemName=\"Laser Printer\",  Quantity=\"144\",  PurchasePrice=\"169.50\",  SellingPrice=\"172.00\", Profit= \"=E3-D3\", LastUpdated =\"05-25-19\",  Rating=\"4.5\" },\r\n                new { ItemCode=\"BJ120K\",  ItemName=\"Scientific Calculator\",  Quantity=\"116\",  PurchasePrice=\"21.80\",  SellingPrice=\"23.00\", Profit= \"=E4-D4\", LastUpdated=\"07-28-19\",  Rating=\"4.0\" },\r\n                new { ItemCode=\"BC120M\",  ItemName=\"Wired Keyboard\",  Quantity=\"438\",  PurchasePrice=\"26.80\",  SellingPrice=\"29.00\", Profit= \"=E5-D5\", LastUpdated=\"03-30-20\",  Rating=\"4.25\" },\r\n                new { ItemCode=\"BS121L\",  ItemName=\"Memory Card\",  Quantity=\"486\",  PurchasePrice=\"23.50\",  SellingPrice=\"25.00\", Profit= \"=E6-D6\", LastUpdated =\"08-20-19\",  Rating=\"3.5\" },\r\n                new { ItemCode=\"BU121K\",  ItemName=\"Coffee Maker\",  Quantity=\"176\",  PurchasePrice=\"56.50\",  SellingPrice=\"59.00\", Profit= \"=E7-D7\", LastUpdated =\"02-02-20\",  Rating=\"4.5\" },\r\n                new { ItemCode=\"BD121M\",  ItemName=\"Table Lamp\",  Quantity=\"0\",  PurchasePrice=\"22.50\",  SellingPrice=\"25.00\", Profit= \"=E8-D8\", LastUpdated =\"11-11-19\",  Rating=\"5.0\" },\r\n            };\r\n            ViewData[\"ConditionalFormattingData\"] = data;\r\n            return View();\r\n        }\r\n\r\n        public IActionResult ConditionalFormatOpen(IFormCollection openRequest)\r\n        {\r\n            OpenRequest open = new OpenRequest();\r\n            open.File = openRequest.Files[0];\r\n            return Content(Workbook.Open(open));\r\n        }\r\n\r\n        public IActionResult ConditionalFormatSave(SaveSettings saveSettings)\r\n        {\r\n            return Workbook.Save(saveSettings);\r\n        }\r\n    }\r\n}"
    }
  ]
}