Repeater Help

V

vinay

Hi,

How to implement Sort for a Repeater Control???

Any samples or references???


<asp:Repeater id="RptProds" runat="server"
EnableViewState="false">

<HeaderTemplate>

<table class="rowover-side" border="0"
id="Table1" width="800" style="BORDER-RIGHT: #666666 1px
solid; BORDER-TOP: #666666 1px solid; OVERFLOW: auto;
BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px
solid; width: 800; BEHAVIOR: url
('../../../unprotected/Includes/htc/tablerowover.htc'); "
cellSpacing="0" cellPadding="0" striped="true">

<thead>

<tr class="tableheadbg"
height="18">

<th align="left"
valign="middle" class="tablehead" style="width:250;">

Promotion
Name</th>

<th align="left"
valign="middle" class="tablehead" style="width:250;">


Description</th>

<th align="left"
valign="middle" class="tablehead" style="width:150;">

Start
Date</th>

<th align="left"
valign="middle" class="tablehead" style="width:150;">

End
Date</th>

</tr>

</thead>

<tbody>

</HeaderTemplate>

<ItemTemplate>

<tr height="18">



<td align="left" valign="middle"
class="tablecopy" ><a class="tablecopylink"
href="javascript: Submit(<%# DataBinder.Eval
(Container.DataItem, "promotion_id") %>)" > <%#
DataBinder.Eval(Container.DataItem, "promotion_name") %
</a></td>

<td align="left" valign="middle"
class="tablecopy"><%# GetDecription(DataBinder.Eval
(Container.DataItem, "Description").ToString()) %></td>



<td align="left" valign="middle"
class="tablecopy"><%# DataBinder.Eval
(Container.DataItem, "START_DATE") %></td>



<td align="left" valign="middle"
class="tablecopy"><%# DataBinder.Eval
(Container.DataItem, "END_DATE") %></td>

</tr>

</ItemTemplate>

<FooterTemplate>
</TABLE>
</FooterTemplate> </asp:Repeater>
 
K

Kevin Spencer

Basically, the only way is to sort the DataSource prior to DataBinding.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,182
Latest member
BettinaPol

Latest Threads

Top