Page View Events are not firing.

9 posts, 2 answers
  1. A2H
    A2H avatar
    177 posts
    Member since:
    Mar 2010

    Posted 13 Oct 2010 Link to this post

    Hi,
    I have a requirement.
    Scenario: I need to develop a  windows application,where i have to use pageview.In my application there are two pageviewpages with strip mode.
    Problem is when i change pageview one page to another ,click events or any server side events are not firing.
    on load of second page I have to load some data in datagrid.
    I called the data populating method inside the click event,but data not get populating since the click event is not firing.

    Please help me.

  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 13 Oct 2010 Link to this post

    Hi,

    If you are using VB, make sure you have wired up the event. 
    You can use the "SelectedPageChanged event to get the selected page. E.g. 
    Private Sub RadPageView1_SelectedPageChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadPageView1.SelectedPageChanged
        MessageBox.Show(Me.RadPageView1.SelectedPage.Text)
    End Sub

    Let me know if you need further help
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 13 Oct 2010 Link to this post

    Hello A2H,

    For the first part Richard is right, check handlers,

    For the second part, if you want to do some lazy loading of data, just once when the page is being created, then you should use page.HandleCreated event, this event will fire only once / page, so you can handle late initialization of pages there (loading data from db, binding controls, and so on).

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  5. A2H
    A2H avatar
    177 posts
    Member since:
    Mar 2010

    Posted 13 Oct 2010 Link to this post

    Hi,
    I am using C# .I have used your logic with some changes respective to c# and its worked.

    Thanks for the Help

    Thanks,
    A2H
  6. Kenny
    Kenny avatar
    2 posts
    Member since:
    Aug 2010

    Posted 19 Oct 2010 Link to this post

    i'm still having issue with my c# code.  If possible, can you share your event code?

    Thanks in advance.
  7. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 19 Oct 2010 Link to this post

    Hello Kenny,

    In C# it's really easy to check if you are registered for events, just check the Designer if you have an event hooked up to the SelectedPageChanged event.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  8. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 19 Oct 2010 Link to this post

    Hi kenny,

    As Emanuel said, it's easy(ier) in C# You should see something like this in your designer file.

    // 
    // radPageView1
    // 
    this.radPageView1.Dock = System.Windows.Forms.DockStyle.Fill;
    this.radPageView1.Location = new System.Drawing.Point(0, 0);
    this.radPageView1.Name = "radPageView1";
    this.radPageView1.Size = new System.Drawing.Size(284, 262);
    this.radPageView1.TabIndex = 0;
    this.radPageView1.Text = "radPageView1";
    this.radPageView1.SelectedPageChanged += new System.EventHandler(this.radPageView1_SelectedPageChanged);
    Hope that helps
    richard
  9. Kenny
    Kenny avatar
    2 posts
    Member since:
    Aug 2010

    Posted 19 Oct 2010 Link to this post

    That worked!  Thank You!!
  10. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 19 Oct 2010 Link to this post

    You're welcome. glad you have it working.
    Richard
Back to Top
UI for WinForms is Visual Studio 2017 Ready