RadTreelist inside RadTreeview.(Urgent)

5 posts, 0 answers
  1. Sindu
    Sindu avatar
    46 posts
    Member since:
    Oct 2011

    Posted 02 Nov 2011 Link to this post



    Hi ,

    My aim is to set RadTreelist control inside the RadTreeview .

    ie is ..

    <

     

     

    telerik:RadTreeView ID="RadTreeView1" Runat="server">

     

    <

     

     

    telerik:RadTreeList ID="RadTreeList1">

     

     

     

     

    </telerik:RadTreeList>

     

     

     

    </telerik:RadTreeView>

     or

     can we set the RadTreelist as a node of the RadTreeview?

    or

    how can I set RadTreelist Control inside the RadTreeview?

    Thanks
    sindu

     

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Nov 2011 Link to this post

    Hello Sindu,

    You can add a TreeList in the NodeTemplate of the TreeView as shown below.
    aspx:
    <telerik:RadTreeView ID="tree" runat="server">
      <Nodes>
         <telerik:RadTreeNode Text="Expand" Expanded="true" >
            <Nodes>
               <telerik:RadTreeNode Text="show" Expanded="true">
                   <NodeTemplate>
                     <telerik:RadTreeList  ID="RadTreeList1" runat="server" AutoGenerateColumns="true" DataSourceID="SqlDataSource1" ParentDataKeyNames="ReportsTo" DataKeyNames="EmployeeID">
                     </telerik:RadTreeList>
                   </NodeTemplate>
              </telerik:RadTreeNode>
           </Nodes>
        </telerik:RadTreeNode>
      </Nodes>
    </telerik:RadTreeView>

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sindu
    Sindu avatar
    46 posts
    Member since:
    Oct 2011

    Posted 02 Nov 2011 Link to this post

    Hi Shinu,

    Thanks you verymuch for your help.
    How can I access RadTreelist from the RadTreeview ?

    I have tried the code 
    RadTreeNode node = tree.Nodes[0];

    RadTreeList List1 = (RadTreeList)node.FindControl("RadTreeList1");

    But then I get ,object reference not set to an instance of the object error.

    so what code should I used for accessing the RadTreelist inside the RadTreeview?

     

     


  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Nov 2011 Link to this post

    Hello Sindu,

    Try the following code snippet to access RadTreeList
    C#:
    protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
      foreach (RadTreeNode node in RadTreeView1.GetAllNodes())
      {
         RadTreeList list =(RadTreeList)node.FindControl("RadTreeList1");
      }
    }

    Thanks,
    Shinu.
  6. Sindu
    Sindu avatar
    46 posts
    Member since:
    Oct 2011

    Posted 03 Nov 2011 Link to this post


    Hi shinu,

    Thanks for your help ...It is working ..
    Another problem arise .

    I have put the RadTreelist inside the RadTreeview .Then the content of the RadTreelist is not  wrapped.If RadTreeList is inside RadTreeview ,then wrapping is not working ...How can we wrap the content and heading?


    Thanks ,
    sindu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017