Fitting tabs to pageview size

2 posts, 0 answers
  1. Sonya L
    Sonya L avatar
    36 posts
    Member since:
    Dec 2009

    Posted 23 May 2011 Link to this post

    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!
  2. Stefan
    Stefan avatar
    2908 posts

    Posted 25 May 2011 Link to this post

    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()
        char[] alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
        foreach (var letter in alpha)
            RadPageViewPage page = new RadPageViewPage();
            page.Text = letter.ToString();
        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,
    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.
Back to Top