Close button

2 posts, 0 answers
  1. Emilien
    Emilien avatar
    2 posts
    Member since:
    Oct 2013

    Posted 14 Oct 2013 Link to this post

    HI

    I need to have a close button on some tab of my PageView, but not all.

    How should i proceed ?


    Thank
  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 17 Oct 2013 Link to this post

    Hello Emilien,

    Thank you for contacting Telerik Support.

    It is necessary to subscribe to the SelectedPageChanged event where to determine whether to display the close button or not: 
    public Form1()
    {
        InitializeComponent();
     
        this.radPageView1.SelectedPageChanged += radPageView1_SelectedPageChanged;
        (radPageView1.ViewElement as RadPageViewStripElement).StripButtons =
            StripViewButtons.Close | StripViewButtons.LeftScroll | StripViewButtons.RightScroll;
    }
     
    private void radPageView1_SelectedPageChanged(object sender, EventArgs e)
    {
        RadPageView pv = sender as RadPageView;
        if (pv != null)
        {
            if (pv.SelectedPage.Name.Contains("3"))
            {
                (radPageView1.ViewElement as RadPageViewStripElement).StripButtons =
                    StripViewButtons.LeftScroll |StripViewButtons.RightScroll;
            }
            else
            {
                (radPageView1.ViewElement as RadPageViewStripElement).StripButtons =
                    StripViewButtons.Close |StripViewButtons.LeftScroll |StripViewButtons.RightScroll;
            }
        }
    }

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top