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

Show Page Header Close Icon

3 Answers 101 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Seth
Top achievements
Rank 1
Seth asked on 05 Apr 2011, 11:46 PM
I've disabled the PageView Header (made invisible), but I'd like to show a close icon for each page within my view. Changing the ShowCloseButton property didn't seem to work. How do I go about showing the icon for each page?
Thanks.

3 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 08 Apr 2011, 03:24 PM
Hello Seth,

Thank you for contacting us.

Please could you give us more details concerning your scenario? Close button is used in StripView and you can hide the Header of ViewElement in the rest view modes.

You can add custom elements in the page Item creating custom RadPageViewItem. Below is an example of adding a RadButtonElement in RadPageViewStackItem:

public class CustomStackItem : RadPageViewStackItem
{
    private RadButtonElement radButtonElement;
 
    protected override void CreateChildElements()
    {
        base.CreateChildElements();
 
        this.radButtonElement = new RadButtonElement();
        this.radButtonElement.Text = "Close";
        this.radButtonElement.Click += new EventHandler(radButtonElement_Click);
        this.Children.Add(radButtonElement);
    }
 
    private void radButtonElement_Click(object sender, EventArgs e)
    {
 
    }
 
    protected override void ArrangeChildren(SizeF available)
    {
        int buttonWidth = 100;
        this.radButtonElement.Arrange(new RectangleF(available.Width - buttonWidth, 0, buttonWidth, available.Height));
 
        base.ArrangeChildren(available);
    }
 
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadPageViewStackItem);
        }
    }
}

You can assign your custom item using the ItemCreating event of RadPageView:

private void radPageView1_ItemCreating(object sender, RadPageViewItemCreatingEventArgs e)
{
    e.Item = new CustomStackItem();
}

Please note that the above event is fired only for pages, added after the subscription to the event.

I hope it helps.

Best regards,
Alexander
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Seth
Top achievements
Rank 1
answered on 08 Apr 2011, 04:07 PM
Alexander,
Thanks for the information.
Attached is a graphic summarizing what I'm trying to achieve. I also submitted this a support incident a couple of days ago, as I am in evaluation phase of your controls and really under a time crunch.
Thanks again.
Seth
0
Alexander
Telerik team
answered on 12 Apr 2011, 06:10 PM
Hello Seth,

Thank you for describing your requirements.

From the screenshot you have provided it seems you use the RadPageView control in ExplorerBar mode. I have added your feature request to our PITS. We will implement it in a future release if more customers request it. FYI, similar to your requirements, SizingGrip resizes a RadPageView page in the control's Outlook mode.

The approach for creating custom RadPageViewItem-s works in all modes of RadPageView except the ExplorerBar mode. I have added this issue to PITS.

Please let me know if I you have additional questions.

Best regards,
Alexander
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
PageView
Asked by
Seth
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Seth
Top achievements
Rank 1
Share this question
or