Question : Finding a repeater item by index?

I have the following repeater:


<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" OnItemDataBound="Repeater_ItemDataBound" >
    <HeaderTemplate>
      <ul id="navbar">
    </HeaderTemplate>
    <ItemTemplate>
      <li><span>
          <asp:ImageButton ID="imgButton" ImageUrl='<%# Bind("Image") %>' runat="server" PostBackUrl='<%# Bind("Path") %>'
            AlternateText='<%# Bind("AltText") %>' CssClass='<%# Bind("Clicked") %>' /></span>
      </li>
    </ItemTemplate>
    <FooterTemplate>
      </ul>
    </FooterTemplate>
</asp:Repeater>

In the Repeater_ItemDataBound is it possible to get a previously bound item by index?

For example say that I was binding the 5th item in the repeater, is it possible to get access to the first item so that I can change the imagebuttons style sheet?

Thanks

Answer : Finding a repeater item by index?

you can assign a style sheet by the following

  e.Row.Attributes("onMouseOver") = "this.className='RSHover'"
            If e.Row.RowIndex Mod 2 = 0 Then
                e.Row.Attributes("onMouseOut") = "this.className='GridRowStyle'"
            Else
                e.Row.Attributes("onMouseOut") = "this.className='GridAlternatingRowStyle'"
            End If

 
Random Solutions  
 
programming4us programming4us