Groups | Blog | Home
all groups > asp.net building controls > may 2005 >

asp.net building controls : Custom Paging in DataGrid


v-schang NO[at]SPAM online.microsoft.com
5/7/2005 12:00:00 AM
Hi Daniel,

Welcome to ASPNET group.
Regarding on the "creating custom pager for webform datagrid", I remember
that there was a former thread discussing on the similiar problem where we
discussing together:

http://groups-beta.google.com/group/microsoft.public.dotnet.framework.aspnet
..webcontrols/browse_thread/thread/eeaac557c9a32a20/fb063bcc9cfd3a60?q=asp.ne
t+datagrid+custom+pager&rnum=1&hl=en#fb063bcc9cfd3a60

In that thread, I suggest that we use the DataGrid's ItemCreated event to
access the grid's Pager template , like:

private void dgPager_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Pager)
{

TableCell tc = e.Item.Controls[0] as TableCell;


if(tc != null)
{
// create own custom pager controls
}
}
}

Do you think this ok or have you encountered any problem when implementing
the custom pager in this way? If there're any paticular requirement, please
feel free to let me know.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Daniel Walzenbach
5/7/2005 9:41:01 AM
Hi,

I want to create my own custom pager for a DataGrid. Does anybody know how
this can be done?

Thanks for your help!
Regards,

AddThis Social Bookmark Button