Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to allow paging for datalist ?

Posted on 2006-11-02
10
Medium Priority
?
278 Views
Last Modified: 2008-02-01
hi
how can i deal with datalist paging
i need full asp.net code to solve it ... i tried to solve it , but it didn't work with me ... i dont know why :(
i want to know how can i show a fixed number of rows in the page
for e.g  ( 6 rows per page )
thnx for help
0
Comment
Question by:thaerali
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 11

Expert Comment

by:ethoths
ID: 17857762
<asp:DataGrid ID="m_dgReports" runat="server" AllowPaging="True" PageSize="6">
0
 

Author Comment

by:thaerali
ID: 17857912
mmmm i think u read my question quickly ... bcoze i asked about datalist not datagrid
i think its clear now :)
 
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17857966
datalist does not supports paging.

You can page the data but you'd need to write sal to pull only the data required. Then add hyperlinks to the page to more to the next a previous pages. Of courcse you need to detect what page you are on and how many pages there are. Finally to need to make sure that the last page only shows the last page of data and not the last full page of data (105 row in databse witha page size of 10 would give 11 pages the last of whihg should only have 5 rows on it).

You can do that or you can just use a datagrid. Using the appropriate css you can make a datagrid look just like a datalist but you get the paging (and sorting) thrown in.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:thaerali
ID: 17858018
aha i understand what u said , and its a good solution , but as i know maybe there is a certain Technique to solve it ...
but really i don't know how ???
anyway thnx for help
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17858115
No there isn't - really. That's why they invented the datagrid. Don't worry about the table like appearance of the grid - you can get rid of it using using styles.
0
 

Author Comment

by:thaerali
ID: 17858219
mmmm so u advice me to use ur solution ..
i.e using table instade of datalist
explain more plz
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17858256
No I said use a datagrid. The datagrid is rendered as a table in HTML but that does not mean it has to look like a table. Many pages on the web use tables for page layout (this one included) and they don't all look like tables of data. I suggest that if you need paging you need to use a datagrid rather than a datalist.

0
 

Author Comment

by:thaerali
ID: 17858353
aha ok
but the problem is i need the form of datalist not datagrid ..
bcoze the datagrid layout is unchangable ,so u can't form the layout that u want unless using table or datalist
for e.g
do u see the form of this current page , which includes my question above and the comments down
i want to program like this page ...  in this shape

i wish u understand me ..
0
 
LVL 11

Accepted Solution

by:
ethoths earned 750 total points
ID: 17858412
1) Turn off auto generate columns.
2) make your datagrid a single column
3) In the template for this column put the html needed to draw the tables to give the loyout you want
4) data-nind you data to html elements in this template.

You could also use an alternating row template if you wanted to have a different layout on each page.
0
 

Author Comment

by:thaerali
ID: 17875684
he man u r grate thnx alot :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question