Integration of RadForm in RadPageView

9 posts, 1 answers
  1. Fabien
    Fabien avatar
    15 posts
    Member since:
    Jul 2009

    Posted 18 Oct 2010 Link to this post

    Dear support team,
     
      I have written an application with 10 forms and need to manually copy code and ressources from RadForm (debug version) to RadPageViewPage (release) and tweak few lines each time...
      As you will probably agree, it's quite painful and hard to maintain.
     
      Do you support the integration of normal RadForm in a RadPageView container ?
      Or Do you have other tip for maintaining this, knowing that it is impossible to edit a derivated RadPageViewPage in Visual Studio 2008 ?
     
      Best regards,
    Fabien.
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 18 Oct 2010 Link to this post

    Hello Fabien,

    I would suggest using a Dock for this, the Dock offers built in support for MDI.

    For even more information about using about docking forms and user controls please check out this help article.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  3. Fabien
    Fabien avatar
    15 posts
    Member since:
    Jul 2009

    Posted 18 Oct 2010 Link to this post

    Dear Emanuel,

      It would probably involve more code redesign to block docking behavior and icons support.
      In this case, it is probably better to use Ribbon, isn't it ?

      Regards,
    Fabien.
  4. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 18 Oct 2010 Link to this post

    Hello again Fabien,

    Me, for one i prefer the Dock for such things, but here you have an example on how to add normal forms to pages as controls, i hope this helps:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Telerik.WinControls.UI;
     
    namespace IntergratingFormsInPageView
    {
        public partial class Form1 : Form
        {
            private RadPageView radPageView1;
            public Form1()
            {
                InitializeComponent();
                this.Controls.Add(radPageView1 = new RadPageView());
                radPageView1.Size = new Size(this.ClientSize.Width, this.ClientSize.Height - 24);
                radPageView1.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
     
                var addFormButton = new RadButton();
                addFormButton.Text = "Add Form";
                addFormButton.Click += new EventHandler(addFormButton_Click);
                addFormButton.Dock = DockStyle.Bottom;
                this.Controls.Add(addFormButton);
            }
     
            void addFormButton_Click(object sender, EventArgs e)
            {
                var childForm = new ChildForm();
                childForm.TopLevel = false;
                childForm.Dock = DockStyle.Fill;
                childForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                 
                var page = new RadPageViewPage();
                childForm.Parent = page;
                page.Text = "Page " + (radPageView1.Pages.Count + 1).ToString();
                page.Controls.Add(childForm);
     
                radPageView1.Pages.Add(page);
                childForm.Show();
            }
        }
     
        public class ChildForm : Form
        {
            public ChildForm()
            {
                InitializeComponent();
                this.Controls.Add(new RadTextBox());
                var grid = new RadGridView();
                grid.Dock = DockStyle.Bottom;
                this.Controls.Add(grid);
            }
     
            private System.ComponentModel.IContainer components;
     
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
     
            #region Windows Form Designer generated code
     
            private void InitializeComponent()
            {
                this.components = new System.ComponentModel.Container();
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.Text = "Form1";
            }
     
            #endregion
        }
    }

    It seems pretty straight forward to me...

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  5. Ras Ran
    Ras Ran avatar
    134 posts
    Member since:
    Nov 2018

    Posted 03 Sep 2019 Link to this post

    hii i have added a Rad form to RadPagView but when i am trying to close a page i can't access Rad form closing event ...whats the reason behind this ? or else is there any other option ? 
  6. Dimitar
    Admin
    Dimitar avatar
    2881 posts

    Posted 04 Sep 2019 Link to this post

    Hello Ranees,

    You can use the events of RadPageView. For example the PageRemoving event.

    I hope this helps. Should you have any other questions, do not hesitate to ask.

    Kind regards,

    Dimitar

    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
  7. Ras Ran
    Ras Ran avatar
    134 posts
    Member since:
    Nov 2018

    Posted 03 Oct 2019 Link to this post

    hiii......i want to close RadPageView page  based on condition...is it possible ??....please check attached picture...in the attached picture you can see a RadButton named Update..in  that condition i want to show a RadMessageBox  by showing "you can't close the current page" white clicking RadPageView Close Button....would you give a solution for this ??
  8. Dimitar
    Admin
    Dimitar avatar
    2881 posts

    Posted 03 Oct 2019 Link to this post

    Hi,

    You can use the following approach for this: 

    public RadForm1()
    {
        InitializeComponent();
        radPageView1.PageRemoving += RadPageView1_PageRemoving;
    
    }
    
    private void RadPageView1_PageRemoving(object sender, RadPageViewCancelEventArgs e)
    {
        if (e.Page.Text == "radPageViewPage1")
        {
            RadMessageBox.Show("Cannot close this page");
            e.Cancel = true;
        }
    }
    

    I hope this helps. Should you have any other questions, do not hesitate to ask.

    Regards,
    Dimitar
    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.
  9. Ras Ran
    Ras Ran avatar
    134 posts
    Member since:
    Nov 2018

    Posted 03 Oct 2019 in reply to Dimitar Link to this post

    thank you so much Dimitar....its worked perfectly...
Back to Top