Fontsize for the elements of RadTreeView

1 Answer 52 Views
Forum suggestions
Shivam
Top achievements
Rank 1
Iron
Shivam asked on 26 Apr 2023, 01:53 PM | edited on 26 Apr 2023, 01:54 PM

How to set fontsize for the elements/child nodes of tree of RadTreeView ?

Below is my sample code: (setting as in below code is not working)

<telerik:RadTreeView  x:Name="treeview"
                           ItemTemplate="{StaticResource xx}"
                           ItemsSource="{Binding yy}"
                           ItemsIndent="0">
            <telerik:RadTreeView.ItemContainerStyle>

               <Style BasedOn="{StaticResource xy}" TargetType="telerik:RadTreeViewItem">
                 <Setter Property="IsExpanded" Value="{Binding ab, Mode=TwoWay}" />

                 <Setter Property="FontSize" Value="20" />

          </telerik:RadTreeView.ItemContainerStyle>
 </telerik:RadTreeView>

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 27 Apr 2023, 03:58 PM

Hello Shivam,

Setting the FontSize property of the RadTreeViewItem element via a Style for the ItemContainerStyle property should change the font size of the elements. However, I see that a custom DataTemplate is set to the ItemTemplate property of the shared RadTreeView implementation. May I ask if the element used to display the RadTreeViewItem's data has a font size set to it (setting the FontSize property)?

I have attached a sample project for you to test, which successfully changes the font size of the items via a Style set to the ItemContainerStyle property.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Forum suggestions
Asked by
Shivam
Top achievements
Rank 1
Iron
Answers by
Stenly
Telerik team
Share this question
or