Edit this page

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)

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

Was this article helpful? Yes No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy