Show Page Header Close Icon

4 posts, 0 answers
  1. Seth
    Seth avatar
    4 posts
    Member since:
    Apr 2011

    Posted 05 Apr 2011 Link to this post

    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.
  2. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 08 Apr 2011 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Seth
    Seth avatar
    4 posts
    Member since:
    Apr 2011

    Posted 08 Apr 2011 Link to this post

    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
  5. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 12 Apr 2011 Link to this post

    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
Back to Top