Skip to content

syncfusion/wpf-ui-components-skills / skills/syncfusion-wpf-checkedlistbox

syncfusion-wpf-checkedlistbox

Verified

Implements the Syncfusion WPF CheckedListBox (CheckListBox) control for multi-select lists with checkboxes. Use this when adding checklist controls, checkbox-enabled item lists, or SelectAll functionality in WPF applications. Covers data binding, appearance customization, grouping/sorting, item selection handling, and virtualization.

references/checking-and-selection-advanced.md

View on GitHub
````markdown
# Checking and Selection — Advanced Examples

This file contains the extended examples and advanced scenarios moved from the main selection reference.

## Programmatic Selection (SelectedItems)

```csharp
// Check specific items by adding to SelectedItems
checkListBox.SelectedItems.Add(item1);
checkListBox.SelectedItems.Add(item2);

// Uncheck items by removing from SelectedItems
checkListBox.SelectedItems.Remove(item1);
```

## SelectedItems binding with MVVM

```csharp
public ObservableCollection<object> CheckedVegetables { get; set; }

// In ViewModel constructor
CheckedVegetables = new ObservableCollection<object>();
CheckedVegetables.Add(Vegetables[0]);
```

```xml
<syncfusion:CheckListBox ItemsSource="{Binding Vegetables}" SelectedItems="{Binding CheckedVegetables}" DisplayMemberPath="Name" />
```

## IsChecked binding (disable virtualization)

```xml
<syncfusion:CheckListBox ItemsSource="{Binding Items}">
  <syncfusion:CheckListBox.Resources>
    <Style TargetType="syncfusion:CheckListBoxItem">
      <Setter Property="IsChecked" Value="{Binding IsChecked}" />
    </Style>
  </syncfusion:CheckListBox.Resources>
  <syncfusion:CheckListBox.ItemsPanel>
    <ItemsPanelTemplate>
      <StackPanel />
    </ItemsPanelTemplate>
  </syncfusion:CheckListBox.ItemsPanel>
</syncfusion:CheckListBox>
```

## Validation Example: Limit maximum selections

```csharp
private void CheckListBox_ItemChecked(object sender, ItemCheckedEventArgs e)
{
    const int maxSelections = 3;
    if (e.IsChecked && checkListBox.SelectedItems.Count > maxSelections)
    {
        checkListBox.SelectedItems.Remove(e.Item);
        MessageBox.Show($"Maximum {maxSelections} items can be selected.");
    }
}
```

## SelectAll behavior notes

- The SelectAll checkbox is tri-state (Unchecked / Intermediate / Checked). Clicking toggles between checked and unchecked; intermediate is shown when some children are selected.

## Troubleshooting

- If SelectedItems doesn't update with data-bound collections, ensure you're binding to the actual item instances (not new instances) and using `ObservableCollection`.
- For virtualization-related synching problems, prefer `SelectedItems` or disable virtualization when necessary.

````
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall