This is a migrated thread and some comments may be shown as answers.

image size

2 Answers 171 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Lily
Top achievements
Rank 1
Veteran
Lily asked on 03 May 2020, 06:18 AM

Sorry this might just be an easy question.  I'm having a hard time finding how to get my image on the navigation view's pages to fit in the tab height.  I've tried a lot but it's not working.  I have another page view that's a backstage view embeded in the navigation view's page view.  With the backstage view, it seems to work when I changed the item fit mode to FillHeight. I've attached a picture of the issue:

2 Answers, 1 is accepted

Sort by
0
Lily
Top achievements
Rank 1
Veteran
answered on 05 May 2020, 03:04 AM
Okay I realized now it's not the FillHeight mode, it was just that that specific icon was just much smaller than the other one.  So how do I shrink it to fit in the Height of the item?
0
Nadya | Tech Support Engineer
Telerik team
answered on 06 May 2020, 12:58 PM

Hello Lily,

According to the attached picture, it seems that you are trying to set an image with a big size. I would like to note that the RadPageViewNavigationViewItems are auto-sized by default. NavigationView switches between different display modes showing only the image or the image and text combined, so stretching the image or setting a maximum size of the item are not acceptable solutions. As a possible solution I would suggest you assign a custom image by setting the appropriate size to the image itself:

RadPageViewNavigationViewElement element = this.radPageView1.ViewElement as RadPageViewNavigationViewElement;
foreach (RadPageViewNavigationViewItem tab in element.Items)
{
    tab.Image = new Bitmap(myImage, new Size(100, 50)); 
}

As to the ItemFillMode property that you mentioned in the previous post defines possible modes to fit items within a RadPageViewStripElement and is applicable when RadPageView is in PageViewMode.Strip. This is why this property is not relevant to your scenario that uses NavigationView.

I hope this helps. Should you have further questions do not hesitate to ask.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
PageView
Asked by
Lily
Top achievements
Rank 1
Veteran
Answers by
Lily
Top achievements
Rank 1
Veteran
Nadya | Tech Support Engineer
Telerik team
Share this question
or