# Calculator Picker

The `RadCalculatorPicker` control is a drop down button with a `RadCalculator` in its drop down content. The button content shows the calculated value of the calculator.

**Defining RadCalculatorPicker**

```XAML
<telerik:RadCalculatorPicker x:Name="calculatorPicker" Height="30" Width="200" />
```

> caption RadCalculatorPicker example

![A picture showing WPF RadCalculatorPicker](https://www.telerik.com/products/wpf/documentation/assets/c1a6187e1cbc69055755eda7629e9033/radcalculatorpicker-basic.png)

The drop down state can be controlled manually with the `IsDropDownOpen` property of `RadCalculatorPicker`.

**Opening the drop down content in code**

```C#
this.calculatorPicker.IsDropDownOpen = true;
```

## DataGrid Integration

The following example shows how to utilize the `RadColorPicker` control as the cell editing element of a `RadGridView` column. To do so, define a custom `CellEditTemplate` for the column and in the `DataTemplate` add the calculator.

**Defining a model for the RadGridView rows**

```C#
public class RowInfo
{
    public string Name { get; set; }
    public double Value { get; set; }
}
```

**Populating the data source**

```C#
public void Example()
{
    InitializeComponent();
    var source = new ObservableCollection<RowInfo>();
    for (int i = 0; i < 10; i++)
    {
        source.Add(new RowInfo() { Name = "Item " + i, Value = 5 });
    }
    DataContext = source;
}
```

**Defining the RadGridView and setting up the RadCalculatorPicker as the cell edit element**

```XAML
<telerik:RadGridView GroupRenderMode="Flat"
						 ItemsSource="{Binding}"						 
						 AutoGenerateColumns="False">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Value}">
            <telerik:GridViewDataColumn.CellEditTemplate>
                <DataTemplate>
                    <telerik:RadCalculatorPicker Value="{Binding Value, Mode=TwoWay}" />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellEditTemplate>
        </telerik:GridViewDataColumn>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>
```

> caption Using RadCalculatorPicker as a cell editor of RadGridView

![A picture showing WPF RadCalculator as the editor of RadGridView cells](https://www.telerik.com/products/wpf/documentation/assets/be35ad05ae8152b64018463b8a4f7bbe/radcalculatorpicker-integrationwithradgridview.png)

## See Also

* [Getting Started](https://www.telerik.com/products/wpf/documentation/controls/radcalculator/getting-started)
