CheckEdit Class

Represents a check box editor.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public class CheckEdit :
    BaseEdit,
    IBooleanExportSettings,
    IExportSettings,
    ICommandSource
Public Class CheckEdit
    Inherits BaseEdit
    Implements IBooleanExportSettings,
               IExportSettings,
               ICommandSource

Remarks

The CheckEdit class represents a check editor that allows end users to edit boolean values.

check-box.png

TIP

The CheckEdit class inherits its features from the BaseEdit class.

Refer to the BaseEdit class description for information on derived features and API.

Create a CheckEdit

<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">

<!-- Specify value using the CheckEdit.IsChecked property -->
<dxe:CheckEdit IsChecked="True" />

<!-- Specify value using the BaseEdit.EditValue property -->
<dxe:CheckEdit EditValue="False" />

Editor Value

Use the CheckEdit.IsChecked property to specify the editor's state. To set the editor to the indeterminate state (if supported), set the CheckEdit.IsChecked property to null.

After the CheckEdit.IsChecked property's value has been changed, the check editor fires the corresponding event (CheckEdit.Checked, CheckEdit.Unchecked or CheckEdit.Indeterminate).

Optional Indeterminate State

Setting the CheckEdit.IsThreeState property to true allows the CheckEdit control to hold a null value. This is called the Indeterminate state.

<dxe:CheckEdit Content="Checked" IsThreeState="True" IsChecked="True"/>
<dxe:CheckEdit Content="Indeterminate" IsThreeState="True" IsChecked="{x:Null}"/>
<dxe:CheckEdit Content="Unchecked" IsThreeState="True" IsChecked="False"/>

checkedit thee states

Appearance Customization

Custom Glyphs

To make the CheckEdit display custom glyphs instead of the standard ones, pass the ImageCheckEditStyleSettings object to the CheckEdit's StyleSettings property.

Use the CheckedGlyph, IndeterminateGlyph, and UncheckedGlyph properties to specify glyphs for all the CheckEdit's states.

<dxe:CheckEdit
  Content="CheckEdit"
  CheckedGlyph="TrafficLightGreen.png"
  UncheckedGlyph="TrafficLightRed.png"
  IndeterminateGlyph="TrafficLightYellow.png"
  IsThreeState="True">
  <dxe:CheckEdit.StyleSettings>
      <dxe:ImageCheckEditStyleSettings />
  </dxe:CheckEdit.StyleSettings>
</dxe:CheckEdit>

The CheckEdit control scales the specified glyphs to 16px. To customize the rendered image size, pass a custom data template to the GlyphTemplate property, as in the code sample below.

<dxe:CheckEdit
    Content="CheckEdit"
    CheckedGlyph="TrafficLightGreen.png"
    UncheckedGlyph="TrafficLightRed.png"
    IndeterminateGlyph="TrafficLightYellow.png"
    IsThreeState="True">
    <dxe:CheckEdit.GlyphTemplate>
        <DataTemplate>
            <Image Source="{Binding}" Height="32" Width="72"/>
        </DataTemplate>
    </dxe:CheckEdit.GlyphTemplate>
    <dxe:CheckEdit.StyleSettings>
        <dxe:ImageCheckEditStyleSettings />
    </dxe:CheckEdit.StyleSettings>
</dxe:CheckEdit>

Custom Content

To specify the editor's content, use the CheckEdit.Content property.

Use the ContentTemplate and ContentTemplateSelector properties to customize the editor's content appearance.

Optimized for In-Place Editing

CheckEdit can be used standalone or as an in-place editor nested in a container control. The CheckEditSettings class implements the in-place editing functionality. See In-place Editors for more information.

See Also