# Selection | WPF Controls | DevExpress Documentation

Use the mouse or touch gestures on touchscreen devices to select series and series points.

![ChartSelection](/WPF/images/chartselection125354.png)

## Selection Mode

The [ChartControl.SelectionMode](/WPF/DevExpress.Xpf.Charts.ChartControl.SelectionMode) property value defines whether you can select chart elements. When this property’s value is set to **None** (default value), end users cannot select a chart’s elements.  The [ElementSelectionMode](/WPF/DevExpress.Xpf.Charts.ElementSelectionMode) enumeration lists all the selection modes. To enable selection, set the **SelectionMode** property to one of the following modes:

| Mode | Example | Description |
| --- | --- | --- |
| Single | ![SingleSelectionElementSelectionMode](/WPF/images/singleselectionelementselectionmode125496.gif) | Only one series element can be selected. Click or tap a series element to select it.<br><br><br>Set the [ChartControl.SelectionMode](/WPF/DevExpress.Xpf.Charts.ChartControl.SelectionMode) property to **ElementSelectionMode.Single** to enable this mode. |
| Multiple | ![MultipleModeElementSelectionMode](/WPF/images/multiplemodeelementselectionmode125502.gif)<br><br><br>![wpf-chart-selection-rectangle](/WPF/images/wpf-chart-selection-rectangle133539.gif) | You can select multiple series elements simultaneously. Click or tap a series element to select it. Hold <kbd>Ctrl</kbd> and click a series element to deselect it.<br><br><br>In this mode, you can also use the Selection Rectangle to select multiple series’s elements. Move the mouse pointer while the <kbd>Ctrl</kbd> key and the left mouse button are pressed to mark series elements to be selected.<br><br><br>Set the [ChartControl.SelectionMode](/WPF/DevExpress.Xpf.Charts.ChartControl.SelectionMode) property to **ElementSelectionMode.Multiple** to enable this mode. |
| Extended | ![ExtendedModeElementSelectionMode](/WPF/images/extendedmodeelementselectionmode125504.gif) | The Extended mode combines the Single and Multiple selection modes’ behaviors.<br><br><ul><br><li>Click an element to select it.</li><br><li>To select/deselect multiple elements, click them while the <kbd>Ctrl</kbd> key is pressed.</li><br></ul><br><br>Set the [ChartControl.SelectionMode](/WPF/DevExpress.Xpf.Charts.ChartControl.SelectionMode) property to **ElementSelectionMode.Extended** to enable this mode. |

## Series Selection Mode

The [ChartControl.SeriesSelectionMode](/WPF/DevExpress.Xpf.Charts.ChartControl.SeriesSelectionMode) property specifies a series element that is selected when you click a series point. The [SeriesSelectionMode](/WPF/DevExpress.Xpf.Charts.SeriesSelectionMode) enumeration contains all possible modes.

| Mode | Example | Description |
| --- | --- | --- |
| Point (default mode) | ![PointSeriesSelectionMode](/WPF/images/pointseriesselectionmode125357.png) | You can select only one series point at a time.<br><br><br>Set the [ChartControl.SeriesSelectionMode](/WPF/DevExpress.Xpf.Charts.ChartControl.SeriesSelectionMode) property to **SeriesSelectionMode.Point** to enable this mode. |
| Argument | ![ArgumentSeriesSelectionMode](/WPF/images/argumentseriesselectionmode125358.png) | This mode allows you to select points with the same argument simultaneously.<br><br><br>Set the [ChartControl.SeriesSelectionMode](/WPF/DevExpress.Xpf.Charts.ChartControl.SeriesSelectionMode) property to **SeriesSelectionMode.Argument** to enable this mode. |
| Series | ![SeriesSelectionMode](/WPF/images/seriesselectionmode125359.png) | In this mode, click a series point to select the entire series.<br><br><br>Set the [ChartControl.SeriesSelectionMode](/WPF/DevExpress.Xpf.Charts.ChartControl.SeriesSelectionMode) property to **SeriesSelectionMode.Series** to enable this mode. |

## Access the Selected Elements

Use the [ChartControl.SelectedItem](/WPF/DevExpress.Xpf.Charts.ChartControl.SelectedItem) or [ChartControl.SelectedItems](/WPF/DevExpress.Xpf.Charts.ChartControl.SelectedItems) properties to access the selected elements.

- XAML

<section id="tabpanel_VO0Zarlh1N_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">&lt;dxc:ChartControl SelectionMode=&quot;Single&quot;
                  SelectedItem=&quot;{Binding Path=SelectedCountry, Mode=TwoWay}&quot;&gt;
        &lt;!-- Other Chart Control&#39;s settings. --&gt;
&lt;/dxc:ChartControl&gt;
</code></pre></section>

## Specify Selection Rectangle’s Appearance

Assign a **DataTemplate** object to the [XYDiagram2D.SelectionTemplate](/WPF/DevExpress.Xpf.Charts.XYDiagram2D.SelectionTemplate) property to specify the Selection Rectangle’s appearance:

- XAML

<section id="tabpanel_VO0Zarlh1N-1_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">&lt;dxc:XYDiagram2D EnableAxisXNavigation=&quot;True&quot; 
                 EnableAxisYNavigation=&quot;True&quot;&gt;
    &lt;dxc:XYDiagram2D.SelectionTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;Border BorderThickness=&quot;1&quot; BorderBrush=&quot;Gray&quot;&gt;
                &lt;Rectangle Opacity=&quot;0.3&quot; Fill=&quot;Gray&quot;/&gt;
            &lt;/Border&gt;
        &lt;/DataTemplate&gt;
    &lt;/dxc:XYDiagram2D.SelectionTemplate&gt;
    &lt;!--...--&gt;
&lt;/dxc:XYDiagram2D&gt;
</code></pre></section>

## Customize the Appearance of Selected Series Points

 Use a [custom series model](/WPF/4285/controls-and-libraries/charts-suite/chart-control/series/series-and-marker-models#custom-model-for-series) to change the appearance of selected series points. 

To change the color of selected series points, follow the steps below:

- Implement a custom model of a particular series ([CustomBar2DModel](/WPF/DevExpress.Xpf.Charts.CustomBar2DModel) in the example below).
- Create a [ControlTemplate](https://learn.microsoft.com/dotnet/api/system.windows.controls.controltemplate) object and assign it to the [CustomBar2DModel.PointTemplate](/WPF/DevExpress.Xpf.Charts.CustomBar2DModel.PointTemplate) property.
- Create the **IsSelectedToBrushConverter** class that implements the [IValueConverter](https://learn.microsoft.com/dotnet/api/system.windows.data.ivalueconverter) interface and contains the **Convert** and **ConvertBack** methods. The **Convert** method returns different colors for selected and unselected series points.
- Bind the **Border.Background** property to the **IsSelected** property and use the **IsSelectedToBrushConverter** object to convert the **IsSelected** value to a color.

- XAML

<section id="tabpanel_VO0Zarlh1N-2_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml"> &lt;Window.Resources&gt;
        &lt;ResourceDictionary&gt;
            &lt;local:IsSelectedToBrushConverter x:Key=&quot;isSelectedConverter&quot;/&gt;
        &lt;/ResourceDictionary&gt;
    &lt;/Window.Resources&gt;
    &lt;Grid&gt;
        &lt;dxc:ChartControl  SelectionMode=&quot;Multiple&quot;  CrosshairEnabled=&quot;False&quot;&gt;
            &lt;dxc:ChartControl.Diagram&gt;
                &lt;dxc:XYDiagram2D&gt;
                    &lt;dxc:XYDiagram2D.Series&gt;
                        &lt;dxc:BarSideBySideSeries2D&gt;
                            &lt;dxc:BarSideBySideSeries2D.Model&gt;
                                &lt;dxc:CustomBar2DModel&gt;
                                    &lt;dxc:CustomBar2DModel.PointTemplate&gt;
                                        &lt;ControlTemplate&gt;
                                            &lt;Border Background=&quot;{Binding IsSelected, Converter={StaticResource isSelectedConverter}}&quot;/&gt;
                                        &lt;/ControlTemplate&gt;
                                    &lt;/dxc:CustomBar2DModel.PointTemplate&gt;
                                &lt;/dxc:CustomBar2DModel&gt;
                            &lt;/dxc:BarSideBySideSeries2D.Model&gt;
                            &lt;!--...--&gt;
                        &lt;/dxc:BarSideBySideSeries2D&gt;
                    &lt;/dxc:XYDiagram2D.Series&gt;
                &lt;/dxc:XYDiagram2D&gt;
            &lt;/dxc:ChartControl.Diagram&gt;
        &lt;/dxc:ChartControl&gt;
    &lt;/Grid&gt;
&lt;/Window&gt;
</code></pre></section>

- C#
- VB.NET

<section id="tabpanel_VO0Zarlh1N-3_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code class="lang-csharp"> public class IsSelectedToBrushConverter : IValueConverter {

    public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture) {
        if (value is bool &amp;&amp; targetType == typeof(Brush)) {
            bool isSelected = (bool)value;
            return isSelected ? Brushes.Black : Brushes.Red;
        }
        return null;
    }

    public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) {
        throw new System.NotImplementedException();
    }
}
</code></pre></section>
<section id="tabpanel_VO0Zarlh1N-3_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code class="lang-vb">Public Class IsSelectedToBrushConverter
    Inherits IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object
        If TypeOf value Is Boolean AndAlso targetType = GetType(Brush) Then
            Dim isSelected As Boolean = CBool(value)
            Return If(isSelected, Brushes.Black, Brushes.Red)
        End If

        Return Nothing
    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object
        Throw New System.NotImplementedException()
    End Function
End Class
</code></pre></section>

[View Example: How to customize the appearance of selected series points](https://github.com/DevExpress-Examples/wpf-chart-customize-the-appearance-of-selected-series-points)

See Also

[How to: Implement Selection in the MVVM Style](/WPF/115265/controls-and-libraries/charts-suite/chart-control/examples/end-user-interaction/how-to-implement-selection-in-the-mvvm-style)