Repeater Help

  • Thread starter Thread starter vinay
  • Start date Start date
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>
 
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.
 
Back
Top