RadOutlookBar's SelectionChanged side effect

9 posts, 1 answers
  1. Agrando
    Agrando avatar
    8 posts
    Member since:
    Nov 2009

    Posted 14 Jan 2010 Link to this post


    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
  2. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 15 Jan 2010 Link to this post

    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.
  3. DevCraft banner
  4. Agrando
    Agrando avatar
    8 posts
    Member since:
    Nov 2009

    Posted 15 Jan 2010 Link to this post

     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
  5. Michael Beverley
    Michael Beverley avatar
    5 posts
    Member since:
    Jul 2012

    Posted 17 May 2010 Link to this post

    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?
  6. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 19 May 2010 Link to this post

    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.
  7. Michael Beverley
    Michael Beverley avatar
    5 posts
    Member since:
    Jul 2012

    Posted 20 May 2010 Link to this post

    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?
  8. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 21 May 2010 Link to this post

    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.
  9. Michael Beverley
    Michael Beverley avatar
    5 posts
    Member since:
    Jul 2012

    Posted 21 May 2010 Link to this post

    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!
  10. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 26 May 2010 Link to this post

    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.
Back to Top
DevCraft banner