Controls display in multiple pages in RadWizard

4 posts, 0 answers
  1. SoniTek
    SoniTek avatar
    43 posts
    Member since:
    Apr 2005

    Posted 28 Sep 2012 Link to this post

    Is there a way to display the same control in RadWizard pages.
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 29 Sep 2012 Link to this post

    Hi Dzung,

    Thank you for writing.

    Yes, you can do that. Here is how to use one and the same RadButton in all pages of the wizard:
    public partial class Form1 : Form
    {
        RadButton radButton1;
     
        public Form1()
        {
            InitializeComponent();
     
            radButton1 = new RadButton();
            radButton1.Text = "hello";
     
            wizardWelcomePage1.ContentArea.Controls.Add(radButton1);
            radWizard1.SelectedPageChanging += new SelectedPageChangingEventHandler(radWizard1_SelectedPageChanging);
        }
     
        void radWizard1_SelectedPageChanging(object sender, SelectedPageChangingEventArgs e)
        {
            e.NextPage.ContentArea.Controls.Add(radButton1);
        }
    }

    I hope this helps.
     
    All the best,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. SoniTek
    SoniTek avatar
    43 posts
    Member since:
    Apr 2005

    Posted 01 Oct 2012 Link to this post

    Hi stefan,

    Thanks for the idea. I went with this and it seems to work.

    #Region "Initialization"
      
        Public Sub New()
      
            ' This call is required by the designer.
            InitializeComponent()
      
            ' Add any initialization after the InitializeComponent() call.
        End Sub
      
        Protected Overrides Sub OnLoad(e As System.EventArgs)
            MyBase.OnLoad(e)
      
            AddHandler RadWizard1.SelectedPageChanged, AddressOf RadWizard1_SelectedPageChanged
            AddHandler RadWizard1.SelectedPageChanging, AddressOf RadWizard1_SelectedPageChanging
        End Sub
    #End Region

     

     

    Private Sub RadWizard1_SelectedPageChanging(sender As Object, e As SelectedPageChangingEventArgs)

     

        e.NextPage.ContentArea.Controls.Add(

     

    Me.RadButton1)

     

     

     

    End Sub

     

  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 04 Oct 2012 Link to this post

    I am glad I could help SoniTek. Let us know if you need anything else.

    All the best,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top