PDA

View Full Version : paging Repeater



aidinwashere
پنج شنبه 19 خرداد 1384, 14:22 عصر
سلام
کسی بلته؟

Farhad.B.S
جمعه 20 خرداد 1384, 21:11 عصر
با استفاده از کلاس PagedDatasource :
http://aspnet.4guysfromrolla.com/articles/081804-1.aspx

aidinwashere
یک شنبه 22 خرداد 1384, 09:01 صبح
متشکرم

javad3151
دوشنبه 23 خرداد 1384, 22:37 عصر
در asp.net 2.0 یه کنترل خیلی باحال برای اینکار وجود داره
این هم مثالش :


<asp:AccessDataSource id="ProductsSource" Runat="Server"
DataFile="../Databases/eCommerce.mdb"
SelectCommand = "SELECT * FROM Products ORDER BY ItemNumber"/>

<asp:Repeater id="RepeaterDisplay" Runat="Server"
DataSourceID="ProductsSource">

<HeaderTemplate>
<table id="RepeaterTable" border="1" style="border-collapse:collapse">
<tr style="background-color:#990000; color:#FFFFFF">
<th>Number</th>
<th>Type</th>
<th>Supplier</th>
<th>Name</th>
<th>Description</th>
<th>Price</th>
<th>Qty.</th>
<th>Sale</th>
<th>Picture</th>
</tr>
</HeaderTemplate>

<ItemTemplate>
<tr style="vertical-align:top">
<td style="width:50px; text-align:center">
<asp:Label Text='<%# Eval("ItemNumber") %>' Runat="Server"/></td>
<td style="width:90px">
<asp:Label Text='<%# Eval("ItemType") %>' Runat="Server"/></td>
<td style="width:90px">
<asp:Label Text='<%# Eval("ItemSupplier") %>' Runat="Server"/></td>
<td style="width:90px">
<asp:Label Text='<%# Eval("ItemName") %>' Runat="Server"/></td>
<td><asp:Panel ScrollBars="Auto" Width="220" Height="60" Runat="Server">
<asp:Label Font-Size="9" Style="line-height:10pt" Runat="Server"
Text='<%# Eval("ItemDescription") %>'/><br/>
</asp:Panel></td>
<td style="width:50px; text-align:right">
<asp:Label Text='<%# FormatNumber(Eval("ItemPrice")) %>' Runat="Server"/></td>
<td style="width:30px; text-align:right">
<asp:Label Text='<%# Eval("ItemQuantity") %>' Runat="Server"/></td>
<td style="text-align:center">
<asp:CheckBox Checked='<%# Eval("ItemSale") %>' Runat="Server"/></td>
<td>
<asp:Image Width="50px" Runat="Server"
ImageUrl='<%# "../Pictures/" & Eval("ItemNumber")& ".jpg"%>'/></td>
</tr>
</ItemTemplate>

<FooterTemplate>
</table>
</FooterTemplate>

</asp:Repeater>

<asp:ContentPager id="Pager" Runat="Server"
ControlToPaginate="RepeaterDisplay"
ItemsPerPage="5"
Mode="Numeric"/>

:موفق: