title: Items are looping all items in Repeater's ItemDataBound event
body: <p>I have a normal <code>Repeater</code> Control in my aspx page</p>
  
  <pre><code> &lt;asp:Repeater ID="rpt1" runat="server" OnItemDataBound="rpt1_ItemDataBound"&gt;
  &lt;ItemTemplate&gt;
  &lt;asp:CheckBox ID="chks" runat="server" /&gt;
  &lt;asp:TextBox ID="txtName" runat="server" CssClass="form-control" Text='&lt;%# DataBinder.Eval(Container,"DataItem.Name").ToString()%&gt;'&gt;&lt;/asp:TextBox&gt;&lt;asp:Label ID="lblValue" runat="server" Visible="false" Text='&lt;%# DataBinder.Eval(Container,"DataItem.Id").ToString() %&gt;'&gt;&lt;/asp:Label&gt;
  &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>On the button click I'm binding data to the <code>Repeater</code> as</p>
  
  <pre><code>rpt1.DataSource = GetData();
  rpt1.DataBind();
  </code></pre>
  
  <p>After binding the <code>ItemDataBound</code> event is called. In that I'm looping through the repeater items for some manipulations</p>
  
  <pre><code>protected void rpt1_ItemDataBound(object sender, RepeaterItemEventArgs e)
  {
  
      foreach (RepeaterItem item in rpt1.Items)
      {
          if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
          {
               string val = ((Label)item.FindControl("lblValue")).Text;
              // Some Stuff
          }
      }
  }
  </code></pre>
  
  <p>The problem is that the loop is getting started from first every time.</p>
  
  <p>For Ex if my data is as 1 2 3 so on.....</p>
  
  <p>It is iterarting as</p>
  
  <pre><code>1
  1 2
  1 2 3
  </code></pre>
  
  <p>How can I make it as</p>
  
  <pre><code>1
  2
  3
  </code></pre>
  
  <p>What am I doing wrong</p>