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

Retrieve radtreelistview child node

6 Answers 326 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Sharada
Top achievements
Rank 1
Sharada asked on 21 Mar 2011, 12:38 PM
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.

6 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 21 Mar 2011, 03:30 PM
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
0
Sharada
Top achievements
Rank 1
answered on 24 Mar 2011, 05:01 AM
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 ?
0
Maseeh
Top achievements
Rank 1
answered on 30 Oct 2012, 05:23 PM
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>

0
Nick
Telerik team
answered on 31 Oct 2012, 12:21 PM
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.

0
Maseeh
Top achievements
Rank 1
answered on 31 Oct 2012, 03:33 PM
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
0
Nick
Telerik team
answered on 02 Nov 2012, 01:16 PM
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.

Tags
TreeListView
Asked by
Sharada
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Sharada
Top achievements
Rank 1
Maseeh
Top achievements
Rank 1
Nick
Telerik team
Share this question
or