datalist custom paging

  • Thread starter Thread starter Clint
  • Start date Start date
C

Clint

Hi,

I am trying to implement the custom paging in the datalist in this format:
<< Prev 1,2,3,4,5 Next >>. Does anyone knows how to do this.

Thanks in advance.

Clint
 
I think your referring to the DataGrid not the DataList? Custom paging is
just what it says it is... custom. You'll have to implement to code to
accomplish your paging. Set the pager to be invisible - i.e. <PagerStyle
Visible="false" />

Have a look at a couple of articles online to try and get your custom paging
solution. A couple I've used myself are
http://www.dotnetjunkies.com/Tutorial/EA868776-D71E-448A-BC23-B64B871F967F.dcik
http://www.4guysfromrolla.com/webtech/082901-1.shtml
http://www.dotnetjunkies.com/Tutorial/07FB766A-35F2-4691-923A-D5F1BA3A12DD.dcik
 
Thanks for the reply. I want to use the DataList to achieve this
because I have a linkbutton on the first row of the datalist control
that when it's clicked, I can hide or show the some of the contents from
a datarow. I saw a posting in google that someone did this with a
datalist, but he didn't post his source codes or how he fixed it.
 
Hi,

You could handle the ItemCreated event and check if: e.Item.ItemType ==
ListItemType.Pager.

If it is, you are creating the pager controls, here you can inspect and
modify the controls collection using e.Item.Controls property. You can
remove and reinsert these controls and apply any formatting you like.
 
Back
Top