Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView overriding InitializePager

Reply
Thread Tools

GridView overriding InitializePager

 
 
Andrew Robinson
Guest
Posts: n/a
 
      04-10-2007
I am overriding the InitializePager method on a grid view and displaying a
customized pager. Is there any way to insure that the method is always
called even if the number of rows is less than the page size? One of the
functions that I am adding is the ability to change the page size but once
the user shows "all" rows, there is no way to get back to the pager and thus
reduce the page size.

Thanks,

 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-11-2007
Hi Andrew,

As for the GridView control, the "InitializePager " method is called by the
"CreateRow" method which is further called by "CreateChildControls", you
can check it through the reflector tool:

=========
protected override int CreateChildControls(IEnumerable dataSource, bool
dataBinding)
{
....
=========

the problem here is that "GridView.CreateChildControls" will always check
the DataSource's itemset to see whether it is pageable, and only when it is
pagable will it create the pager, there hasn't exposed a built-in interface
for us to force the pager be displayed.

If you do want to display some infomration when the records count is not
pagable, do you think it is possible to use the GridView footer to display
them or manually use a wrapper table around the gridview to display the
information?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.










 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-13-2007
Hi Andrew,

Any progress on this issue or does the suggestion in my last reply helps
you a little? If there is anything else we can help, please feel free to
post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
overriding GridView.OnRowDeleting - can call registered event handlers TS ASP .Net Building Controls 12 11-11-2008 02:36 PM
Overriding Gridview Control a ASP .Net Datagrid Control 2 02-08-2007 12:39 PM
Overriding GridView Mark Baldwin ASP .Net 1 01-11-2007 02:54 AM
GridView override InitializePager columnSpan problem when using BoundField Visible=false J055 ASP .Net Web Controls 4 06-14-2006 03:04 PM
Problem with OnItemCreated and InitializePager being called four times Bernal Schooley ASP .Net Datagrid Control 0 04-05-2004 02:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57