3 Answers, 1 is accepted
0
Hello zalak m,
Can you elaborate on your issue a little bit more? Are you looking for expand on mouse move?
Regards,
Hristo Milyakov
the Telerik team
Can you elaborate on your issue a little bit more? Are you looking for expand on mouse move?
Regards,
Hristo Milyakov
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
0
zalak m
Top achievements
Rank 1
answered on 13 Aug 2010, 05:43 PM
Hi,
I want to first expand the first level of the RadTreeView and the want to capture the mousemove of the second level in the RadTreeView.
Thanks.
I want to first expand the first level of the RadTreeView and the want to capture the mousemove of the second level in the RadTreeView.
Thanks.
0
Hi zalak m,
You can attach an event handler to the MouseMove event of the data template content objects. Following code demonstrates what I mean:
Lets say our tree is composed of 3 levels, where the first level are the Teams, second are the Members of that teams and third are the tasks for each person. You can register event handler to the content of the data template for the second tree level. In current example this is the MouseMove event of the Border element inside the HierarchicalDataTemplate "PersonTemplate".
If you don't know the structure of the tree in advance, probably you are going to need some mechanism to distinguish if the item is on second level or not.
Also, I'm attaching a working sample demonstrating how to programmatically expand tree item and how to handle the mouse move over second level items in the tree view.
Kind regards,
Hristo Milyakov
the Telerik team
You can attach an event handler to the MouseMove event of the data template content objects. Following code demonstrates what I mean:
<HierarchicalDataTemplate x:Key=
"PersonTemplate"
ItemTemplate=
"{StaticResource TaskTemplate}"
ItemsSource=
"{Binding Tasks}"
>
<Border Background=
"Azure"
Margin=
"0"
Width=
"140"
Height=
"20"
MouseMove=
"Border_MouseMove"
>
<StackPanel>
<TextBlock Text=
"{Binding Name}"
/>
</StackPanel>
</Border>
</HierarchicalDataTemplate>
Lets say our tree is composed of 3 levels, where the first level are the Teams, second are the Members of that teams and third are the tasks for each person. You can register event handler to the content of the data template for the second tree level. In current example this is the MouseMove event of the Border element inside the HierarchicalDataTemplate "PersonTemplate".
If you don't know the structure of the tree in advance, probably you are going to need some mechanism to distinguish if the item is on second level or not.
Also, I'm attaching a working sample demonstrating how to programmatically expand tree item and how to handle the mouse move over second level items in the tree view.
Kind regards,
Hristo Milyakov
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