# spreadsheet-advanced-conditional-formatting

> SfSpreadsheet with advanced conditional formatting rules, color scales, and format rule management.

**Framework:** wpf  **Component:** Spreadsheet  **Variant:** advanced-conditional-formatting

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/wpf/spreadsheet-advanced-conditional-formatting.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.SfSpreadsheet.WPF
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/spreadsheet-advanced-conditional-formatting/Spreadsheet.xaml

```xaml
<UserControl
    x:Class="AdvancedConditionalFormatting.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
    SnapsToDevicePixels="True" Unloaded="OnSampleUnloaded">

    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- The ribbon that hosts the conditional formatting commands -->
        <syncfusion:SfSpreadsheetRibbon x:Name="sfSpreadsheetRibbon"
                                        Grid.Row="0"
                                        DataContext="{Binding ElementName=spreadsheetControl}" />

        <!-- The workbook with its conditional formatting rules -->
        <syncfusion:SfSpreadsheet x:Name="spreadsheetControl"
                                  Grid.Row="1"
                                  FormulaBarVisibility="Visible"
                                  WorkbookLoaded="spreadsheetControl_WorkbookLoaded" />
    </Grid>
</UserControl>

```
