# Selecting an Item in the C1OutlookBar

## Content



[C1OutlookBar](/componentone/api/wpf/online-outlookbar/dotnet-framework-api/C1.WPF.OutlookBar.4.6.2/C1.WPF.OutlookBar.C1OutlookBar.html) supports single item selection and allows you to programmatically select an item, giving you control over which item is selected when a user first views the [C1Outlookbar](/componentone/api/wpf/online-outlookbar/dotnet-framework-api/C1.WPF.OutlookBar.4.6.2/C1.WPF.OutlookBar.C1OutlookBar.html).

Suppose you have a [C1OutlookBar](/componentone/api/wpf/online-outlookbar/dotnet-framework-api/C1.WPF.OutlookBar.4.6.2/C1.WPF.OutlookBar.C1OutlookBar.html) named **C1OutlookBar1** which contains several [C1OutlookItem](/componentone/api/wpf/online-outlookbar/dotnet-framework-api/C1.WPF.OutlookBar.4.6.2/C1.WPF.OutlookBar.C1OutlookItem.html)**s**, one of which is named _selectedItem_:

```xml
<c1:C1OutlookBar x:Name="C1OutlookBar1 ">
<c1:C1OutlookItem x:Name="selectedItem" Header="Tasks">
```

1.  Choose **View | Code** from the Visual Studio menu.
2.  Add the following code to your project:
    
    ```csharp
    using C1.Silverlight.OutlookBar;
    namespace C1OutlookBar
    {
        public partial class MainPage : UserControl
        {
            public MainPage()
            {
                InitializeComponent();
                C1OutlookBar1.SelectedItem = (C1OutlookItem)selectedItem;
            }
        }
    }
    ```
    
3.  Run the project and notice the [C1OutlookItem](/componentone/api/wpf/online-outlookbar/dotnet-framework-api/C1.WPF.OutlookBar.4.6.2/C1.WPF.OutlookBar.C1OutlookItem.html) named **selectedItem**, or in this example the **Tasks** item, is selected.
    
    ![](https://cdn.mescius.io/document-site-files/images/db635c5e-6066-484d-b52e-211cb3bb2abd/imagesext/image12_15.png)