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

Compare the Header RadTreeViewItem with the Header RadPane

4 Answers 23 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
LRScudeletti
Top achievements
Rank 1
LRScudeletti asked on 23 Oct 2013, 11:39 AM
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?

4 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 28 Oct 2013, 11:40 AM
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 >>
0
LRScudeletti
Top achievements
Rank 1
answered on 30 Oct 2013, 06:58 PM
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!
0
Accepted
Vladi
Telerik team
answered on 04 Nov 2013, 02:34 PM
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 >>
0
LRScudeletti
Top achievements
Rank 1
answered on 07 Nov 2013, 08:04 PM
Thank you.
Tags
TreeView
Asked by
LRScudeletti
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
LRScudeletti
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or