Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine the repeater row count in asp.net

How i can determine the amount of rows which display in this repeater at once?

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="News" EnableViewState="true">
  <ItemTemplate>
    <hr />
    <div style="color:#036e90; font-weight: bold; font-family:Tahoma; text-align:center ; padding-left:10px"><a href="DisplayNews.aspx"><%#DataBinder.Eval(Container.DataItem, "News_Name")%></a></div>
                <div style=" FONT-SIZE: 10pt;  FONT-FAMILY: Tahoma ; text-align:center;padding-left:10px"><%#DataBinder.Eval(Container.DataItem, "News_Description")%></div>
    <br />
             <hr  />
  </ItemTemplate>
</asp:Repeater>
like image 299
samar Avatar asked May 14 '11 04:05

samar


1 Answers

This should work too:

((Container.Parent as Repeater).DataSource as IList).Count

like image 131
Duned Avatar answered Sep 29 '22 10:09

Duned