Link to home
Start Free TrialLog in
Avatar of directxBOB
directxBOBFlag for Ireland

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Kamal Khaleefa
Kamal Khaleefa
Flag of Kuwait image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial