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
    Admin
    Stefan avatar
    2891 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()
    {
        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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top