This question is locked. New answers and comments are not allowed.
Due to org charts being quite large in some cases, we wanted a way to bring the appropriate node into focus via a text search
I have tried using a combination of the BringIntoView and ContainerFromItemRecursive Methods without any luck.
Glenn.
I have tried using a combination of the BringIntoView and ContainerFromItemRecursive Methods without any luck.
Glenn.
10 Answers, 1 is accepted
0
Hello Glenn,
What is the problem? Getting a reference to the item or bringing the item into the view?
Regards,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
What is the problem? Getting a reference to the item or bringing the item into the view?
Regards,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Aaron
Top achievements
Rank 1
answered on 20 Aug 2008, 08:04 AM
Hi Valentin,
I think this is similar to Glenn's query.
I am wondering if Telerik Treeview supports focus changing on nodes via text search. I am not sure of the proper word that explains this functionality, so I'll give an example.
Eg.
I have a treeview like this:
- Chris
- James
- John
- William
I have Chris selected/highlighted.
When I press the Letter 'J' on the keyboard, the 'James' node is automatically selected.
When I press the Letter 'W' on the keyboard, the 'William' node is automatically selected.
I have noticed other suites appear to have this functionality built in (eg. ComponentOne TreeView). Is this possible with the Telerik TreeView control? I was unable to do so in the demo.
Thanks,
Aaron
I think this is similar to Glenn's query.
I am wondering if Telerik Treeview supports focus changing on nodes via text search. I am not sure of the proper word that explains this functionality, so I'll give an example.
Eg.
I have a treeview like this:
- Chris
- James
- John
- William
I have Chris selected/highlighted.
When I press the Letter 'J' on the keyboard, the 'James' node is automatically selected.
When I press the Letter 'W' on the keyboard, the 'William' node is automatically selected.
I have noticed other suites appear to have this functionality built in (eg. ComponentOne TreeView). Is this possible with the Telerik TreeView control? I was unable to do so in the demo.
Thanks,
Aaron
0
Hello Aaron,
Thanks for the feedback!
The incremental search functionality is still not available, but we will do our best to include it with the next major release of the control.
Best wishes,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks for the feedback!
The incremental search functionality is still not available, but we will do our best to include it with the next major release of the control.
Best wishes,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andy Grimes
Top achievements
Rank 1
answered on 02 Oct 2008, 08:39 PM
My question is similar to Glenn's which I do not think was answered.
Let's say I have an Org chart that is several layers deep.
(ie. Corporate - VP's - Sr. Management - Management - Employee)
If I want to find who a particular Employee reports to via. a search by Employee number or name how would I do this? The Item used to populate the tree has all of the information needed.
If I am able to locate the Item that corresponds to an employee in the data source shouldn't I be able to use "ContainerFromItemRecursive" to find the matching RadTreeViewItem?
So far I am only able to find an item from the tree if it is a direct child of the primary node.
Let's say I have an Org chart that is several layers deep.
(ie. Corporate - VP's - Sr. Management - Management - Employee)
If I want to find who a particular Employee reports to via. a search by Employee number or name how would I do this? The Item used to populate the tree has all of the information needed.
If I am able to locate the Item that corresponds to an employee in the data source shouldn't I be able to use "ContainerFromItemRecursive" to find the matching RadTreeViewItem?
So far I am only able to find an item from the tree if it is a direct child of the primary node.
0
Andy Grimes
Top achievements
Rank 1
answered on 02 Oct 2008, 08:51 PM
Additional information.
The purpose of a search is to display to the user in the tree the relationship of Employee to Management. Once the RadTreeViewItem is found the node can be highlighted and the Parent Node expanded so the node can be seen.
Transversing a ObservableCollection object to find an Item is easily done and much quicker that trying to transverse the tree. Once the item is found how do we locate the associated node?
Is it necessary for me to recursivly transverse the tree and cast each item object to my object type so that I can check the properties or is there an easier way?
The purpose of a search is to display to the user in the tree the relationship of Employee to Management. Once the RadTreeViewItem is found the node can be highlighted and the Parent Node expanded so the node can be seen.
Transversing a ObservableCollection object to find an Item is easily done and much quicker that trying to transverse the tree. Once the item is found how do we locate the associated node?
Is it necessary for me to recursivly transverse the tree and cast each item object to my object type so that I can check the properties or is there an easier way?
0
Hi Andy Grimes,
you don't get the reference when call the ContainerFromItemRecursive, because the treeview item container is still not generated from the Silverlight framework. It is not generated because of the UI of the items is not displayed e.g. the parent node of the item is not expanded.
Check this forum thread for more info in this concept:
http://www.telerik.com/community/forums/thread/b311D-begaeb.aspx
Also check-out this online examples for more about the container generation:
http://demos.telerik.com/silverlight/#Examples/TreeView/AccessingItems
Kind regards,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
you don't get the reference when call the ContainerFromItemRecursive, because the treeview item container is still not generated from the Silverlight framework. It is not generated because of the UI of the items is not displayed e.g. the parent node of the item is not expanded.
Check this forum thread for more info in this concept:
http://www.telerik.com/community/forums/thread/b311D-begaeb.aspx
Also check-out this online examples for more about the container generation:
http://demos.telerik.com/silverlight/#Examples/TreeView/AccessingItems
Kind regards,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andy Grimes
Top achievements
Rank 1
answered on 10 Oct 2008, 05:18 PM
Valentin,
Thanks for the reply.
I reviewed both examples and, unless I misunderstood something, found that they only work when the containers have already been generated. For my situation this is not the optimum solution.
As a work around I found that I could use ExpandAll to generate the entire tree and then use the ItemContainerGenerator functions to access the desired nodes.
However I found that there is no way of being notified when the tree containers have completed generation. The Expanded event fires when the expanssion begins and not when the container generation is completed. This requires that I make a guess at the time the generation is completed before I can begin accessing the nodes.
Is there an event I can use that I missed to determine when the node generation is completed, or will there be an event in future builds?
Any information you can provide to allow me to select nodes further down the tree hiearchy would be greatly appreciated.
Thanks for the reply.
I reviewed both examples and, unless I misunderstood something, found that they only work when the containers have already been generated. For my situation this is not the optimum solution.
As a work around I found that I could use ExpandAll to generate the entire tree and then use the ItemContainerGenerator functions to access the desired nodes.
However I found that there is no way of being notified when the tree containers have completed generation. The Expanded event fires when the expanssion begins and not when the container generation is completed. This requires that I make a guess at the time the generation is completed before I can begin accessing the nodes.
Is there an event I can use that I missed to determine when the node generation is completed, or will there be an event in future builds?
Any information you can provide to allow me to select nodes further down the tree hiearchy would be greatly appreciated.
0
Hi Andy Grimes,
you can handle the RadTreeViewItem.ItemContainerGenerator.StatusChanged event and to see what is the container generator status. When the Status property of the ItemContainerGenerator become GeneratorStatus.ContainersGenerated you are safe to access the child containers.
Best wishes,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
you can handle the RadTreeViewItem.ItemContainerGenerator.StatusChanged event and to see what is the container generator status. When the Status property of the ItemContainerGenerator become GeneratorStatus.ContainersGenerated you are safe to access the child containers.
Best wishes,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andy Grimes
Top achievements
Rank 1
answered on 13 Oct 2008, 03:41 PM
Thanks for the reply Valentin,
I am not sure how to implement your advice.
As far as I can tell the "RadTreeViewItem.ItemContainerGenerator.StatusChanged" event that you refer to is not at the tree level but at the level of each container. As far as I understand this it would require me manually map the event to the children of the parent node and then expand these nodes. When the event is fired with the "GeneratorStatus.ContainersGenerated" status I would then need to manually map the event to the children nodes that were just generated and start the process over again until the last level was reached.
Is this correct or am I missing something? If this is correct it seems like a lot of work to go through to find out that the entire tree has been generated.
Any help you can provide would be appreciated.
I am not sure how to implement your advice.
As far as I can tell the "RadTreeViewItem.ItemContainerGenerator.StatusChanged" event that you refer to is not at the tree level but at the level of each container. As far as I understand this it would require me manually map the event to the children of the parent node and then expand these nodes. When the event is fired with the "GeneratorStatus.ContainersGenerated" status I would then need to manually map the event to the children nodes that were just generated and start the process over again until the last level was reached.
Is this correct or am I missing something? If this is correct it seems like a lot of work to go through to find out that the entire tree has been generated.
Any help you can provide would be appreciated.
0
Hi Andy Grimes,
--------
Is this correct or am I missing something?
------
Yes this is the way for the moment. I don't like that you have to do all this code, we are not happy with this solution and we are looking for a way to simplify it. Unfortunately the virtualization of the items is not done by us, but from the framework. I hope that until the official launch of the Telerik suite we will be able to resolve this issue.
Let's move the discussion in this thread, so we can keep all our comments in one place, until we find the best implementation:
http://www.telerik.com/community/forums/thread/b311D-bgmadt.aspx
Thanks!
Regards,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
--------
Is this correct or am I missing something?
------
Yes this is the way for the moment. I don't like that you have to do all this code, we are not happy with this solution and we are looking for a way to simplify it. Unfortunately the virtualization of the items is not done by us, but from the framework. I hope that until the official launch of the Telerik suite we will be able to resolve this issue.
Let's move the discussion in this thread, so we can keep all our comments in one place, until we find the best implementation:
http://www.telerik.com/community/forums/thread/b311D-bgmadt.aspx
Thanks!
Regards,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
