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

Fitting tabs to pageview size

1 Answer 217 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Sonya L
Top achievements
Rank 1
Sonya L asked on 23 May 2011, 03:31 PM
I have a tabstrip (radpageview), containing the letters of the alphabet that is used to filter the results in a grid (if I click A, all rows starting with A are shown).  I would like to adjust the tab height so that all letters/tabs fit into the height of the pageview control.  I have tried changing many different settings (including the previously mentioned min size) without any luck.  Nothing seems to change the height of the tabs.  How can I accomplish this?  Thanks!

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 25 May 2011, 03:36 PM
Hello Sonya,

Thank you for writing.

You can show all items in the stack area by making use of the ItemFitMode property of RadPageViewStripElement. Setting this property to ShrinkAndFill will reduce the items size just enough to fit them all in the strip area. Here is a sample code demonstrating this:
public Form1()
{
    InitializeComponent();
    char[] alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
    foreach (var letter in alpha)
    {
        RadPageViewPage page = new RadPageViewPage();
        page.Text = letter.ToString();
        radPageView1.Pages.Add(page);
    }
 
    RadPageViewStripElement stripElement = (RadPageViewStripElement)this.radPageView1.ViewElement;
    stripElement.StripAlignment = StripViewAlignment.Left;
    stripElement.ItemContainer.TextOrientation = Orientation.Vertical;
    stripElement.ItemFitMode = StripViewItemFitMode.ShrinkAndFill;           
}

I hope you find this information helpful. Should you have any other questions, do not hesitate to contact us.
 
All the best,
Stefan
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
PageView
Asked by
Sonya L
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or