{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-conditional-formatting",
  "framework": "aspnet-mvc",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "conditional-formatting",
  "dependencies": [
    "Syncfusion.AspNetMvc.Spreadsheet"
  ],
  "description": "Spreadsheet editor with conditional formatting rules applied to data ranges.",
  "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/aspnet-mvc/llms.txt",
    "skillPack": "syncfusion/aspnetmvc-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/aspnet-mvc/spreadsheet-editor-conditional-formatting.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-conditional-formatting/SpreadsheetEditor.cshtml",
      "content": "@using Syncfusion.EJ2\n\n@section ControlsSection{\n    <div class=\"control-section\">\n        @Html.EJS().Spreadsheet(\"spreadsheet\").OpenUrl(\"ConditionalFormattingOpen\").SaveUrl(\"ConditionalFormattingSave\").Created(\"createdHandler\").Sheets(sheet =>\n   {\n\t   sheet.Name(\"Inventory List\").Rows(row =>\n\t   {\n\t\t   row.Height(30).Cells(cell =>\n\t\t   {\n\t\t\t   cell.Index(1).Value(\"Inventory List\").Add();\n\t\t   }).Add();\n\t   }).Ranges(ranges =>\n\t   {\n\t\t   ranges.DataSource(ViewData[\"ConditionalFormattingData\"]).StartCell(\"A2\").Add();\n\t   }).Columns(column =>\n\t   {\n\t\t   column.Width(100).Add();\n\t\t   column.Width(158).Add();\n\t\t   column.Width(72).Add();\n\t\t   column.Width(113).Add();\n\t\t   column.Width(113).Add();\n\t\t   column.Width(77).Add();\n\t\t   column.Width(97).Add();\n\t\t   column.Width(73).Add();\n\t   }).Add();\n   }).Render()\n    </div>\n}\n\n<script>\n    function createdHandler() {\n        var excelObj = this;\n\t\texcelObj.merge('A1:H1');\n        excelObj.cellFormat({ fontWeight: 'bold', textAlign: 'center' }, 'A2:H2');\n        excelObj.cellFormat({ fontWeight: 'bold', textAlign: 'center', verticalAlign: 'middle', fontSize: '13pt' }, 'A1:H1');\n\t\texcelObj.numberFormat('$#,##0.00', 'D3:F18');\n        excelObj.numberFormat('m/d/yyyy', 'G3:G18');\n        excelObj.conditionalFormat({ type: 'BlueDataBar', range: 'D3:D18' });\n\t\texcelObj.conditionalFormat({ type: 'GreenDataBar', range: 'E3:E18' });\n        excelObj.conditionalFormat({ type: 'ThreeStars', range: 'H3:H18' });\n\t\texcelObj.conditionalFormat({ type: 'LessThan', value: '8-8-2019', range: 'G3:G18' });\n\t\texcelObj.conditionalFormat({ type: 'GYRColorScale', range: 'C3:C18' });\n\t\texcelObj.conditionalFormat({ type: \"Top10Items\", value: '1', format: { style: { color: '#ffffff', backgroundColor: '#009999',\n            fontWeight: 'bold' } }, range: 'F3:F18' });\n\t\texcelObj.conditionalFormat({ type: \"Bottom10Items\", value: '1', format: { style: { color: '#ffffff', backgroundColor: '#c68d53',\n            fontWeight: 'bold' } }, range: 'F3:F18' });\n    }\n</script>\n\n<style>\n    .control-section {\n        height: 550px;\n    }\n\n    #sb-content .e-spreadsheet .e-tab .e-tab-text {\n        display: inherit;\n    }\n</style>\n"
    },
    {
      "target": "src/components/spreadsheet-editor-conditional-formatting/SpreadsheetEditorController.cs",
      "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.Mvc;\nusing Syncfusion.EJ2.Spreadsheet;\n\nnamespace EJ2MVCSampleBrowser.Controllers.Spreadsheet\n{\n    public partial class SpreadsheetController : Controller\n    {\n        public ActionResult ConditionalFormatting()\n        {\n            List<object> data = new List<object>()\n            {\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\" },\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\" },\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\" },\n            };\n            ViewData[\"ConditionalFormattingData\"] = data;\n            return View(\"~/Views/Home/spreadsheet-editor/conditional-formatting/SpreadsheetEditor.cshtml\");\n        }\n\n        public ActionResult ConditionalFormattingOpen(OpenRequest openRequest)\n        {\n            return Content(Workbook.Open(openRequest));\n        }\n\n        public void ConditionalFormattingSave(SaveSettings saveSettings)\n        {\n            if (saveSettings != null && saveSettings.JSONData != null)\n            {\n                Workbook.Save(saveSettings);\n            }\n        }\n    }\n}"
    }
  ]
}