This is a migrated thread and some comments may be shown as answers.

Selected Item

1 Answer 61 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Kevin Marois
Top achievements
Rank 1
Kevin Marois asked on 20 Oct 2011, 11:48 PM
In the C# Code behind, how do you set the selected item to an item already in the control. My XAML is

<telerik:RadOutlookBar x:Name="RadOutlookBar"
                     Grid.Column="0"
                     SelectedItem="{Binding SelectedSection, Mode=TwoWay}">
  
</telerik:RadOutlookBar>

So in the view model, I want to iterate through all the Items, find one, then set the control's selected item to it. How do you iterate over the items collection?

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 24 Oct 2011, 05:36 PM
Hi Kevin Marois,

I am not sure when you want to iterate through the items collection, but basically you don't have to use any of the RadOutlookBar properties as long as its ItemsSource is bound to a business collection and its SelectedItem is bound in a TwoWay mode to one of the items of this collection.

In this case you can only work with the business data - iterate through the business collection of items that is used as the ItemsSource of the RadOutlookBar. And set the SelectedSection data item to one of the items from that business collection.

I attached a sample project that illustrates my points. Please have a look at the solution and let me know if it works for you or if I'm missing something from your scenario.

Greetings,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
OutlookBar
Asked by
Kevin Marois
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or