5 Answers, 1 is accepted
0
Rahul
Top achievements
Rank 2
answered on 29 Feb 2012, 11:38 AM
Hi Ruth,
Please check out below code to apply tooltip for checkbox in tree view.
Thanks & Regards
Rahul
Please check out below code to apply tooltip for checkbox in tree view.
<Grid x:Name="LayoutRoot"> <Grid.Resources> <DataTemplate x:Key="Team"> <StackPanel Orientation="Horizontal"> <CheckBox Click="CheckBox_Click" ToolTipService.ToolTip="Check Me"/> <TextBlock Text="{Binding Name}" /> </StackPanel> </DataTemplate> <telerik:HierarchicalDataTemplate x:Key="Division" ItemTemplate="{StaticResource Team}" ItemsSource="{Binding Teams}"> <TextBlock Text="{Binding Name}" /> </telerik:HierarchicalDataTemplate> <telerik:HierarchicalDataTemplate x:Key="League" ItemTemplate="{StaticResource Division}" ItemsSource="{Binding Divisions}"> <TextBlock Text="{Binding Name}" /> </telerik:HierarchicalDataTemplate> </Grid.Resources> <telerik:RadTreeView Name="radTreeView" ItemTemplate="{StaticResource League}"> </telerik:RadTreeView> </Grid>Thanks & Regards
Rahul
0
Hi Rahul,
All the best,
Petar Mladenov
the Telerik team
We are glad to know that you have found a way to achieve this functionality. In the attached project you can find another approach - the default template of the RadTreeViewItem is extracted from Blend and the same Tooltip is applied in the ChechBoxElement:
<CheckBox ToolTipService.ToolTip="Check Me" x:Name="CheckBoxElement" Grid.Column="2" IsTabStop="False" Margin="5,0,0,0" telerik:StyleManager.Theme="{StaticResource Theme} " Visibility="Collapsed" VerticalAlignment="Center"/>Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Ruth
Top achievements
Rank 1
answered on 05 Mar 2012, 06:53 PM
Rahul and Petar,
Thank you for your code samples.
Rahul - I need to see a tool tip when user is hovering over the checkbox without actually clicking it.
Petar - I am trying not to have a checkbox in a data template. I would prefer to utilize
Thank you for your code samples.
Rahul - I need to see a tool tip when user is hovering over the checkbox without actually clicking it.
Petar - I am trying not to have a checkbox in a data template. I would prefer to utilize
IsTriStateMode="True" IsOptionElementsEnabled="True" ItemsOptionListType="CheckList" to display a checkbox on a treeview. Is it still possible to display a tool tip for a checkbox?
0
Hello Ruth ,
Do not hesitate to ask if you need further assistance.
Greetings,
Petar Mladenov
the Telerik team
So I guess the project I attached is just what you need. Please note that I have used the default TriState Behavior and I have not included CheckBox in the ItemsTemplate:
<Grid.Resources> <telerik:HierarchicalDataTemplate x:Key="itemtemplate" ItemsSource="{Binding Children}" > <TextBlock Text="{Binding Name}" /> </telerik:HierarchicalDataTemplate> </Grid.Resources> <telerik:RadTreeView x:Name="tree" IsExpandOnSingleClickEnabled="false" IsLineEnabled="True" IsOptionElementsEnabled="True" IsTriStateMode="True" ItemTemplate="{StaticResource itemtemplate}" />Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Ruth
Top achievements
Rank 1
answered on 06 Mar 2012, 11:42 PM
Thank you, Petar!