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

RadOutlookBar's SelectionChanged side effect

8 Answers 112 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Vitec Agrando AB
Top achievements
Rank 1
Vitec Agrando AB asked on 14 Jan 2010, 01:00 PM

I have a RadOutlookBar containing few RadOutlookBarItems. Each RadOutlookBarItem has TreeView as content. The problem is that whenever I select a RadOutlookBarItem, it fires the TreeView's SelectedItemChanged and selects the first TreeViewItem. How can I stop the TreeView's SelectedItemChanged event from being fired?
 <Grid x:Name="LayoutRoot" Height="300" VerticalAlignment="Top"
        <Grid.ColumnDefinitions> 
            <ColumnDefinition Width="200"/> 
            <ColumnDefinition></ColumnDefinition
        </Grid.ColumnDefinitions> 
        <telerikNavigation:RadOutlookBar Grid.Row="1" x:Name="RadOutlookBar1"
            <telerikNavigation:RadOutlookBarItem Header="OneTwoThree" > 
                <controls:TreeView x:Name="tv1" /> 
            </telerikNavigation:RadOutlookBarItem> 
            <telerikNavigation:RadOutlookBarItem Header="123"
                <controls:TreeView x:Name="tv2" /> 
            </telerikNavigation:RadOutlookBarItem> 
            <telerikNavigation:RadOutlookBarItem Header="ABC"
                <controls:TreeView x:Name="tv3" /> 
            </telerikNavigation:RadOutlookBarItem> 
        </telerikNavigation:RadOutlookBar> 
    </Grid> 

  public partial class MainPage : UserControl 
    { 
        public MainPage() 
        { 
            InitializeComponent(); 
            tv1.ItemsSource = new List<string>() { "One""Two""Three" }; 
            tv2.ItemsSource = new List<string>() { "1""2""3" }; 
            tv3.ItemsSource = new List<string>() { "A""B""C" }; 
        } 
    } 

Regards
Mesfin

8 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 15 Jan 2010, 08:44 AM
Hello Mesfin,

Judging from the information you have provided us with, I see that you are using the TreeView from the Silverlight Toolkit. If you substitute the Toolkit's TreeView with our RadTreeView, you will see that the SelectionChanged event does not fire while switching between OutlookBar items. Let me explain why. When you switch between OutlookBar items, the ItemsSource of the newly switched TreeView (no matter if it is Toolkit's TreeView or RadTreeView) gets reset. The difference is that when the ItemsSource gets reset, the Toolkit's TreeView tries to select its first item, thus firing SelectedItemChanged, while RadTreeView does not select its first item. Try substituting the Toolkit's TreeView with RadTreeView and let me know if this works for you. I'd be glad to further assist you.

Regards,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Vitec Agrando AB
Top achievements
Rank 1
answered on 15 Jan 2010, 12:35 PM
 Hi Kiril Stanoev

Thank you very much for your quick and explanatory reply.
You are right, it was the Toolkit's TreeView which was firing the event.   

Regards
Mesfin
0
Michael Beverley
Top achievements
Rank 1
answered on 17 May 2010, 08:10 PM
Hello Kiril,

I have a related question regarding child controls of a RadOutlookBarItem and the SelectionChanged() event. When you mentioned that the TreeViews' ItemsSource gets "Reset" above, does that mean it re-binds to the originally declared datasource? Or is it wiping out any declarative bindings that exist? I ask because I have an OutlookBar with OutlookBarItems that contain declaratively databound RadGridViews, and after the initial load of the control (which works fine), any subsequent switching between OutlookBarItems results in the RadGridViews displaying empty (no data.) Any ideas/thoughts?
0
Kiril Stanoev
Telerik team
answered on 19 May 2010, 11:55 AM
Hi Michael,

I was unable to reproduce this behavior. I've attached a sample project that tries to mimic the scenario you described. Instead of a GridView I am using a RadTreeView, but the result should be the same. Give it a try and let me know if this helps. I'd be glad to further assist you.

Best wishes,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Michael Beverley
Top achievements
Rank 1
answered on 20 May 2010, 07:37 PM
Sorry, should have mentioned - we're using these inside the prism framework from Microsoft, doing view injection. Are there any known issues with using Telerik controls inside of Prism Modules?
0
Kiril Stanoev
Telerik team
answered on 21 May 2010, 10:40 AM
Hello Michael,

Thank you for the clarification. We aren't aware of any existing issues between RadOutlookBar and Prism. I'm attaching a sample project that demonstrates the usage of RadOutlookBar in Prism scenario. If you continue to experience the same issue, could you please send us a sample project so we can better determine what is causing the problem.

Greetings,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Michael Beverley
Top achievements
Rank 1
answered on 21 May 2010, 04:38 PM
Hi Kiril,

The plot thickens: we downloaded the source for the controls from your site today, and we are not seeing the same issue I've been describing - the databinding works correctly when the controls are built from your source. (There are also some memory issues we'd been seeing with the binaries that no longer appear as well.) Are we correct in assuming that the source that's available is older than the latest binary releases? Is it possible that this is a bug that's been introduced between the version available in source and the latest version available in binary (RadControls_for_WPF_2010_1_0515_Dev)? Thanks for your help!
0
Kiril Stanoev
Telerik team
answered on 26 May 2010, 02:51 PM
Hello Michael,

In general it is not likely but it is still possible that the issue was introduced after the source code release. Next week we are going to have a Service Pack release. Could you please download the Service Pack binaries once they are available and confirm whether the issue is still present or not. This way we will be better able to determine the cause for the issue.

Kind regards,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
OutlookBar
Asked by
Vitec Agrando AB
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Vitec Agrando AB
Top achievements
Rank 1
Michael Beverley
Top achievements
Rank 1
Share this question
or