This is a migrated thread and some comments may be shown as answers.

Page View Events are not firing.

8 Answers 189 Views
PageView
This is a migrated thread and some comments may be shown as answers.
A2H
Top achievements
Rank 1
A2H asked on 13 Oct 2010, 09:29 AM
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.

8 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 13 Oct 2010, 10:46 AM
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
0
Emanuel Varga
Top achievements
Rank 1
answered on 13 Oct 2010, 11:07 AM
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
0
A2H
Top achievements
Rank 1
answered on 13 Oct 2010, 03:26 PM
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
0
Kenny
Top achievements
Rank 1
answered on 19 Oct 2010, 09:19 PM
i'm still having issue with my c# code.  If possible, can you share your event code?

Thanks in advance.
0
Emanuel Varga
Top achievements
Rank 1
answered on 19 Oct 2010, 09:22 PM
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
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 19 Oct 2010, 09:52 PM
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
0
Kenny
Top achievements
Rank 1
answered on 19 Oct 2010, 10:22 PM
That worked!  Thank You!!
0
Richard Slade
Top achievements
Rank 2
answered on 19 Oct 2010, 10:26 PM
You're welcome. glad you have it working.
Richard
Tags
PageView
Asked by
A2H
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Emanuel Varga
Top achievements
Rank 1
A2H
Top achievements
Rank 1
Kenny
Top achievements
Rank 1
Share this question
or