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

Integration of RadForm in RadPageView

8 Answers 581 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Fabien
Top achievements
Rank 1
Fabien asked on 18 Oct 2010, 09:58 AM
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.

8 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 18 Oct 2010, 12:46 PM
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
0
Fabien
Top achievements
Rank 1
answered on 18 Oct 2010, 01:13 PM
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.
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 18 Oct 2010, 01:28 PM
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
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 03 Sep 2019, 12:37 PM
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 ? 
0
Dimitar
Telerik team
answered on 04 Sep 2019, 12:49 PM

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
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 03 Oct 2019, 07:23 AM
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 ??
0
Dimitar
Telerik team
answered on 03 Oct 2019, 11:18 AM

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.
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 03 Oct 2019, 11:56 AM
thank you so much Dimitar....its worked perfectly...
Tags
PageView
Asked by
Fabien
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Fabien
Top achievements
Rank 1
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
Dimitar
Telerik team
Share this question
or