New to Telerik UI for WinForms? Download free 30-day trial

Programatically adding pages

This help article will demonstrate how RadPageViewPages can be added to RadPageView programmatically.

Programmatically adding RadPageViewPages to RadPageView

Simply all that has to be done is to create an instance of RadPageViewPage, set the desired properties (i.e Text, Font etc), and add the instance to the Pages collection of RadPageView. The following code snippet demonstrated this behavior:

Adding pages


RadPageViewPage pageOne = new RadPageViewPage();
pageOne.Text = "First Page";
radPageView1.Pages.Add(pageOne);

RadPageViewPage pageTwo = new RadPageViewPage();
pageTwo.Text = "Second Page";
radPageView1.Pages.Add(pageTwo);

Dim pageOne As New RadPageViewPage()
pageOne.Text = "First Page"
radPageView1.Pages.Add(pageOne)
Dim pageTwo As New RadPageViewPage()
pageTwo.Text = "Second Page"
radPageView1.Pages.Add(pageTwo)

In case you need to add a page at a certain position, feel free to use the Pages.Insert method passing the desired position index and the RadPageViewPage instance you want to add.

Adding Controls to RadPageViewPage

Additionally, adding other controls to a specified RadPageViewPage programmatically, can be achieved by simply adding the desired control to the Controls collection of the desired page, as shown in the next example:

Adding controls to a page


RadButton button = new RadButton();
button.Text = "My Button";
pageOne.Controls.Add(button);

Dim button As New RadButton()
button.Text = "My Button"
pageOne.Controls.Add(button)

See Also

In this article