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

Programmatically 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";

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

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

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";

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

See Also

In this article