Retrieve radtreelistview child node

7 posts, 0 answers
  1. Sharada
    Sharada avatar
    43 posts
    Member since:
    Mar 2009

    Posted 21 Mar 2011 Link to this post

    Hi,

    I am using radtreelistview in order to display hierarchical data. I need to find all the child node for a particular parent node .
    I tried the following code

    var

     

     

    childNodes = (currentrow as Telerik.Windows.Controls.TreeListView.TreeListViewRow).ChildrenOfType<Telerik.Windows.Controls.TreeListView.TreeListViewRow>();

     

     But the above code doesn't return anything.
    Is there an in-built feature available in the current version? The control version used is 2011.1.223.35.
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 21 Mar 2011 Link to this post

    Hello Sharada,

     
    Why do not you get the information on a data level?
    Imagine that you have a class WarehouseItem with a property Items of type ObservableCollection<WarehouseItem>. You can easily get the child nodes of any item by observing its Items property. 
    Will that be applicable for your scenario ? May give us more information about your particular requirements?

    Kind regards,
    Vanya Pavlova
    the Telerik team
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sharada
    Sharada avatar
    43 posts
    Member since:
    Mar 2009

    Posted 24 Mar 2011 Link to this post

    Thanks for the prompt reply.I was able to get the child nodes using the items property.But I am facing 1 more problem.
    I need to sum up all child nodes data at runtime (On  RadTreeListView1_CellEditEnded event).Since I am using RowVirtualization on radtreelistview , I am able to get only those child nodes which are in the view.Can you suggest an alternative way of getting the child nodes which are not in the view ?
  5. Maseeh
    Maseeh avatar
    2 posts
    Member since:
    Sep 2012

    Posted 30 Oct 2012 Link to this post

    Hey Vanya
    I have the same problem with retrieving children of a parent node in RadTreeListView. I have a column with check boxes and I want to be able to check all the children of a node by checking the parent node.

    I don't know if RadTreeListView has that kind of functionality but if i can retrieve all the children of a parent node I can take care of the rest programatically. But I can't find a way to get the children of a parent node. Is the link between the parent and children private?

    Please Help

    thanks

    <telerik:RadTreeListView HorizontalAlignment="Left" IsReadOnly="True" Margin="0,58,0,0" SelectionMode="Multiple" Name="trAllRequests" VerticalAlignment="Top" Height="630" Width="473" AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserSortGroups="False" CanUserSelect="False">
         
        <telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}"/>
        </telerik:RadTreeListView.ChildTableDefinitions>
         
        <telerik:RadTreeListView.Columns>
            <telerik:GridViewDataColumn  DataMemberBinding="{Binding Name}" Header="Name" />
            <telerik:GridViewDataColumn  DataMemberBinding="{Binding PracticeName}" Header="Practice"/>
            <telerik:GridViewDataColumn  DataMemberBinding="{Binding DateCreated}" Header="Date"/>
     
            <telerik:GridViewDataColumn Width=".1*">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                        <CheckBox Name="chkRequestSelecttion" Checked="chkRequestSelecttion_Checked" Unchecked="chkRequestSelecttion_Unchecked"/>
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
     
     
        </telerik:RadTreeListView.Columns>

  6. Nick
    Admin
    Nick avatar
    593 posts

    Posted 31 Oct 2012 Link to this post

    Hello Sharada,

    Are you trying to get the Visual elements or just the Business objects behind the TreeList? 

    Looking forward to hearing from you! 

    Kind regards,
    Nikolay Vasilev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Maseeh
    Maseeh avatar
    2 posts
    Member since:
    Sep 2012

    Posted 31 Oct 2012 Link to this post

    Hey Nikolay,
    I have the same issue. I am trying to get access to the visual element of the tree, not the underlying data objects. (Please see my earlier post in this thread)

    thanks
  8. Nick
    Admin
    Nick avatar
    593 posts

    Posted 02 Nov 2012 Link to this post

    Hi Maseeh,

    Unfortunately, You cannot get the containers of the Items that are not loaded in the view port, without turning off the RowVirtualization. Can you elaborate a little bit more on your final goal so we can suggest an alternative approach?

    Looking forward to hearing from you! 

    All the best,
    Nikolay Vasilev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready