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

Find treeview inside panelbar itemtemplate

3 Answers 139 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Anil Kumar
Top achievements
Rank 2
Anil Kumar asked on 09 Apr 2010, 01:00 PM
I want to find the tree view so I bind the data, how can I find the RadTreeView1 inside the Rad-PanelBar
here is my code if anyone know please give me the code.


 <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Skin="Forest"
        <Items> 
            <telerik:RadPanelItem Text="Panel1"
                <Items> 
                    <telerik:RadPanelItem Text="ProfileTree"
                        <Items> 
                            <telerik:RadPanelItem Text=""
                                <ItemTemplate> 
                                    <telerik:RadTreeView runat="server" ID="RadTreeView1"
                                      
                                    </telerik:RadTreeView> 
                                </ItemTemplate> 
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelItem> 
                    <telerik:RadPanelItem Text="Demo"
                    </telerik:RadPanelItem> 
                    <telerik:RadPanelItem Text="Demo1"
                    </telerik:RadPanelItem> 
                    <telerik:RadPanelItem Text="Demo2"
                    </telerik:RadPanelItem> 
                </Items> 
            </telerik:RadPanelItem> 
            <telerik:RadPanelItem Text="Services"
                <Items> 
                    <telerik:RadPanelItem Text="Demo"
                    </telerik:RadPanelItem> 
                </Items> 
            </telerik:RadPanelItem> 
        </Items> 
    </telerik:RadPanelBar> 

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 09 Apr 2010, 01:13 PM
Hi Anil Kumar,

Please check this help article which explains how to access the controls inside templates of RadPanelBar.

Kind regards,
Yana
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
Anil Kumar
Top achievements
Rank 2
answered on 09 Apr 2010, 01:42 PM
Hi Yana,

its little helpful but in the example that you send me, the colorpicker sets the color to the labes on on selected event
but in my situation i want to bind data in the tree view look at the code ....
and thanks for your quick help
0
Accepted
Princy
Top achievements
Rank 2
answered on 09 Apr 2010, 02:25 PM
Hello Anil Kumar,

Access the corresponding PanelBarItem and use the FindControl() method in order to access the RadTreeView.

C#:
 
    RadPanelItem item = (RadPanelItem)RadPanelBar1.FindItemByValue("Value1"); 
    RadTreeView treeview = (RadTreeView)item.FindControl("RadTreeView1"); 

Set the Value for the RadPanelItem as shown below
ASPX:
 
 <telerik:RadPanelItem Text="" Value="Value1">  
       <ItemTemplate>  
            <telerik:RadTreeView runat="server" ID="RadTreeView1">                                        
            </telerik:RadTreeView>  
       </ItemTemplate>  
  </telerik:RadPanelItem>  

Thanks,
Princy.
Tags
PanelBar
Asked by
Anil Kumar
Top achievements
Rank 2
Answers by
Yana
Telerik team
Anil Kumar
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or