Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Extending DataPager

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 17 Mar 2008 14:23 GMT
Hello,

I am trying to extend DataPager control to have predefined template
fields.

 Public Class WebPager
   Inherits DataPager

   Protected Overloads Overrides Sub OnInit(ByVal e As
EventArgs)
     MyBase.OnInit(e)
     Dim field As New TemplatePagerField
     field.PagerTemplate = New WebPagerTemplate()
     Me.Fields.Add(field)
     Me.Fields.Add(field)
   End Sub

 End Class

And the template field is defined as follows:

 Public Class WebPagerTemplate
   Implements ITemplate

   Public Sub InstantiateIn(ByVal container As Control) Implements
ITemplate.InstantiateIn
     ...
   End Sub

 End Class

The problem is that I need to run some code inside the
TemplatePagerField's Command event.

So I need to override it right?

How can I do this?

And should I do it in class WebPager or in WebPagerTemplate.

In my opinion I should override the OnCommand event in
WebPagerTemplate but I don't know how to do it.

Could someone, please, help me out?

Thanks,

Miguel
shapper - 17 Mar 2008 20:49 GMT
> Hello,
>
[quoted text clipped - 44 lines]
>
> Miguel

Hello,

I found the following:

"The OnPagerCommand method also enables derived classes to handle the
event without attaching a delegate. This is the preferred technique
for handling the event in a derived class.

Notes to Inheritors:
When you override OnPagerCommand in a derived class, call the base
class's OnPagerCommand method so that registered delegates receive the
event."

In this article:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.templatepager
field.onpagercommand.aspx


However, I am not sure how to do this.

Could someone, please, help me out?

I don't know to to start.

Thanks,
Miguel

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.