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

Using the Close Button in Backstage Mode

3 Answers 161 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 08 Aug 2019, 09:47 AM

I need your help.

When Pageview's View Mode is set to Backstage mode, nothing happens when the Close button is clicked.

Is this normal?
If not, what should I do?

The button's enable attribute is True and the Visible attribute is also Visibility.
However, the Close Button does nothing.

I would be grateful if you could let me know how it works.
Expect a quick answer.

3 Answers, 1 is accepted

Sort by
0
Bryan
Top achievements
Rank 1
answered on 09 Aug 2019, 04:20 AM

Dev Environment

Telelik runtime version is v4.0.30319( 2015.2.728.40 )

VS2013 (C# winform)

 

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 Aug 2019, 08:24 AM
Hello, Bryan,    

According to the provided information, I suppose that you set the RadPageView.ViewElement.ShowItemCloseButton property to true. It determines whether the CloseButton will be displayed in each item (page), allowing that item to be closed. This property is relevant for the PageViewMode.Strip

However, if you need to have if for the Backstage view as well, I have prepared a sample code snippet how to achieve it:

public RadForm1()
{
    InitializeComponent();
    this.radPageView1.ViewMode = PageViewMode.Backstage;
}
 
private void RadForm1_Load(object sender, EventArgs e)
{
    this.radPageView1.ViewElement.ShowItemCloseButton = true;
 
    foreach (RadPageViewStripItem item in this.radPageView1.ViewElement.Items)
    {
        item.ButtonsPanel.CloseButton.Visibility = ElementVisibility.Visible;
        item.ButtonsPanel.CloseButton.Text = "X";
        item.ButtonsPanel.CloseButton.Click += CloseButton_Click;
    }
}
 
void CloseButton_Click(object sender, EventArgs e)
{
    this.radPageView1.Pages.Remove(((RadPageViewButtonElement)sender).FindAncestor<RadPageViewStripItem>().Page);
}

I hope this information helps.
 
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Bryan
Top achievements
Rank 1
answered on 13 Aug 2019, 07:19 AM

Thank you very much for your help.

It was very very helpful for me.

 

 

Tags
PageView
Asked by
Bryan
Top achievements
Rank 1
Answers by
Bryan
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or