Hierarchy navigationview

1 Answer 104 Views
PageView
atfat
Top achievements
Rank 1
Iron
Iron
atfat asked on 07 Oct 2021, 02:34 PM

hi 

is there any way to display the parent titles page in a red bold style font and the subpage title in a regular black font programmatically in hierarchy navigation view mode

thanks in advanced

regards

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 08 Oct 2021, 04:29 AM

Hello, Atfat,

Indeed, you can change the Font for specific page. In your case, you can check whether a page has subPages and set a custom font if that is true. You can achieve that as follows:

FontFamily myFontFamily = new FontFamily("Segoe UI");
Font myFont = new Font(
myFontFamily,
12f,
FontStyle.Bold,
GraphicsUnit.Pixel);

for (int i = 0; i < this.radPageView1.Pages.Count; i++)
{
    RadPageViewPage currentPage = this.radPageView1.Pages[i];
    RadPageViewNavigationViewItem navigationViewItem = currentPage.Item as RadPageViewNavigationViewItem;
    if (navigationViewItem.Page.SubPages.Count > 0)
    {
        navigationViewItem.Font = myFont;
        navigationViewItem.ForeColor = Color.Red;
    }
}

I hope you find this information useful.

Regards,
Dimitar
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
atfat
Top achievements
Rank 1
Iron
Iron
commented on 11 Oct 2021, 01:24 PM

Hi,

thank you a lot Dimtar

regards

Tags
PageView
Asked by
atfat
Top achievements
Rank 1
Iron
Iron
Answers by
Dimitar
Telerik team
Share this question
or