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

Close button

1 Answer 154 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Emilien
Top achievements
Rank 1
Emilien asked on 14 Oct 2013, 02:35 PM
HI

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

How should i proceed ?


Thank

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Oct 2013, 11:11 AM
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 >>
Tags
PageView
Asked by
Emilien
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or