RadPanelBarItem isn't deselected

8 posts, 0 answers
  1. m v klingeren
    m v klingeren avatar
    11 posts
    Member since:
    Mar 2010

    Posted 28 Jun 2010 Link to this post

     Im selecting the child item of my RadBarPaneltem (level 1), using

    private void SelectFirstRadBarItemChild(object sender, RadRoutedEventArgs e) 
            { 
                RadPanelBarItem rbItem = (RadPanelBarItem)sender; 
     
                if (rbItem.Level == 1) 
                { 
     
                    RadPanelBarItem rbItemChild = (RadPanelBarItem)rbItem.Items[0]; 
                    rbItemChild.IsSelected = true
                } 
            } 

    i attached this to the Expanded event of my RadPanelBarItem's (on level 1)

    <telerikNavigation:RadPanelBarItem Header="First Item" Expanded="SelectFirstRadBarItemChild">

    this does work, but when i select another level 2 item under the same RadPanelBarItem, the programmatically selected item
    doesnt get deselected.

    How do i make sure other items under the Level1 item get deselected first?
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 01 Jul 2010 Link to this post

    Hello m v klingeren,

    I couldn't reproduce the issue you described. However, I am not sure how do you declare the RadPanelBar items. So I prepared a sample project. Can you please take a look at it and let me know if it works for you and if it illustrates your scenario correctly. If it doesn't can you please modify it accordingly so that we can further investigate the issue?

    Thank you in advance.

    Sincerely yours,
    Tina Stancheva
    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
  3. DevCraft banner
  4. m v klingeren
    m v klingeren avatar
    11 posts
    Member since:
    Mar 2010

    Posted 02 Jul 2010 Link to this post

    You example works partly, problem is that if you now use the Selected /or MouseLeftButtonUp) events of the childs (ie <telerikNavigation:RadPanelBarItem Header="Content1.1"/>)

    the first item stays selected.

    What can i do about this?

    -edit: you're example is a bit disappointing, since its working exactly the same way as my given example..

    i need some backup Telerik!!
  5. m v klingeren
    m v klingeren avatar
    11 posts
    Member since:
    Mar 2010

    Posted 07 Jul 2010 Link to this post

    Telerik home?
  6. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 07 Jul 2010 Link to this post

    Hi m v klingeren,

    Sorry for the delayed reply. What exactly do you mean by saying:

    if you now use the Selected /or MouseLeftButtonUp) events of the childs (ie <telerikNavigation:RadPanelBarItem Header="Content1.1"/>)

    I ran Tina's project and the PanelBar behaved as expected. I've attached a video demonstrating my interaction with the PanelBar. On expand, the first sub-item gets selected. After that I am able to successfully select another item and deselect the programatically selected item.

    Is it something else you have on your end. I'd be glad if can attach a sample project reproducing the issue. This way we will be better able to assist you.

    On a side note, I'd like to inform you that we've just released an online tool that allows you to reduce the size of your Silverlight applications. For more information, please visit http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx

    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
  7. m v klingeren
    m v klingeren avatar
    11 posts
    Member since:
    Mar 2010

    Posted 07 Jul 2010 Link to this post

    I ported your project to Visual Studio 2008, see attached project

    in VS2010 it works, in 2008 it doesnt!!


    example project: http://www.intersoftware.nl/documenten/examplefortelerik.zip
  8. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 12 Jul 2010 Link to this post

    Hello m v klingeren,

    It appears the issue is caused by the way Silverlight 3 and 4 work. If you add a dispatcher in the RadPanelBarItem_Expanded event handler everything should be working properly.

    private void RadPanelBarItem_Expanded(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        Dispatcher.BeginInvoke(() =>
        {
            RadPanelBarItem rbItem = (RadPanelBarItem)sender;
     
            if (rbItem.Level == 1)
            {
                RadPanelBarItem rbItemChild = (RadPanelBarItem)rbItem.Items[0];
                rbItemChild.IsSelected = true;
            }
        });
    }

    Give it a try and let me know how it works.

    All the best,
    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. m v klingeren
    m v klingeren avatar
    11 posts
    Member since:
    Mar 2010

    Posted 13 Jul 2010 Link to this post

    Fantastic, thumbs up for telerik!
Back to Top
DevCraft banner