Find treeview inside panelbar itemtemplate

4 posts, 1 answers
  1. Anil Kumar
    Anil Kumar avatar
    13 posts
    Member since:
    Mar 2010

    Posted 09 Apr 2010 Link to this post

    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> 

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Apr 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anil Kumar
    Anil Kumar avatar
    13 posts
    Member since:
    Mar 2010

    Posted 09 Apr 2010 Link to this post

    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
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Apr 2010 Link to this post

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