Compare the Header RadTreeViewItem with the Header RadPane

5 posts, 1 answers
  1. LRScudeletti
    LRScudeletti avatar
    6 posts
    Member since:
    Oct 2013

    Posted 23 Oct 2013 Link to this post

    I have a RadPaneGroup and RadTreeview, I compare a RadTreeViewItem Header Header with the RadPane Header and close the RadPane when RadTreeViewItem is selected. How do I?
    
    TreeView
    
    <telerik:RadTreeView  x:Name="tvConfiguracao" IsOptionElementsEnabled="True" Checked="tvConfiguracao_Checked"
          <telerik:RadTreeViewItem x:Name="tviVenda" Header="VENDA" />
          <telerik:RadTreeViewItem x:Name="tviCompra"  Header="COMPRA />               
    </telerik:RadTreeView>
    Panels
    <telerik:RadDocking x:Name="rdPrincipal"                             
                <telerik:RadSplitContainer InitialPosition="DockedBottom">
                    <telerik:RadPaneGroup x:Name="rpgFiltros"
                        <telerik:RadPane x:Name="RadPaneCompra" Header="COMPRA"> </telerik:RadPane>
                        <telerik:RadPane x:Name="RadPaneVenda" Header="Venda"> </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
    </telerik:RadDocking>
    Event
    private void tvConfiguracao_Checked(object sender, Telerik.Windows.RadRoutedEventArgs e)
           {
               var item = rdPrincipal.Panes.FirstOrDefault(i => i.Header == e.Source.Cast<RadTreeViewItem>().Header);
      
               if (item != null)
                   item.Cast<RadPane>().IsHidden = true;
           }
    Finds no Pane Even with Header, what is wrong?
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 28 Oct 2013 Link to this post

    Hi Rogerio,

    I think the issue might be caused by the different upper/lower casing you're using for the headers. It might be best to make sure that the case of the Header string of both the RadTreeViewItems and the RadPanes is the same. For instance you can make all letters in a lower case like this:
    var item = rdPrincipal.Panes.FirstOrDefault(i => i.Header.ToString().ToLower() == (e.Source as RadTreeViewItem).Header.ToString().ToLower());
    This should get the proper item.

    Regards,
    Tina Stancheva
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. LRScudeletti
    LRScudeletti avatar
    6 posts
    Member since:
    Oct 2013

    Posted 30 Oct 2013 Link to this post

    Hello!

    Thanks for the trouble! But I still have a problem, See the example:

    My RadTreeView design

    [ x ] COMPRA
    [ x ] VENDA
    [   ] ALUGUEL
     
    x = TreeViewItem CheckState = On

    My RadPane design

    |COMPRA| |VENDA|

    When I deselect the TreeViewItem, I close the pane that has the same header.

    var item = myRadSplitContainer.EnumeratePanes()FirstOrDefault(i => i.Header == e.Source.Cast<RadTreeViewItem>().Header);
       
               if (item != null)
                   item.Cast<RadPane>().IsHidden = true;

    However if Panes are floating I can not close them or recover them. How do I close and restore panes that are floating?

    Thank you!
  5. Answer
    Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 04 Nov 2013 Link to this post

    Hi,

    We are not aware of such issues in the current version of RadDocking when setting the IsHidden property of floating RadPanes.

    I recorded a short video for you showing how the scenario runs on our side. Please let us know if we have missed something.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. LRScudeletti
    LRScudeletti avatar
    6 posts
    Member since:
    Oct 2013

    Posted 07 Nov 2013 Link to this post

    Thank you.
Back to Top
UI for WPF is Visual Studio 2017 Ready