Questions tagged [repeater]

The Repeater control is used to display a repeated list of items that are bound to the control.

The ASP.NET Repeater is a basic container control that allows you to create custom lists from any data available to the page. It's a handy control, especially since most ASP.NET pages that display data need to repeat the same kinds of data over and over.

2797 questions
122
votes
8 answers

How to find controls in a repeater header or footer

I was wondering how one would find the controls in the HeaderTemplate or FooterTemplate of an Asp.Net Repeater control. I can access them on the ItemDataBound event, but I was wondering how to get them after (for example to retrieve a value of an…
mbillard
  • 38,386
  • 18
  • 74
  • 98
107
votes
7 answers

ASP.NET Repeater bind List

I am binding a List to a Repeater control. Now I want to use the Eval function to display the contents in ItemTemplate like <%# Eval("NAME") %>. But I am not sure what I should use instead of NAME.
josephj1989
  • 9,509
  • 9
  • 48
  • 70
85
votes
2 answers

ASP.net Repeater get current index, pointer, or counter

the question is really simple. Is there a way to access the current pointer/counter for an asp Repeater control. I have a list with items and I would like one of the repeaters columns (it repeats and html table) to be something like ... Item 1 |…
Jan W.
  • 1,761
  • 5
  • 26
  • 28
56
votes
8 answers

ASP.NET repeater alternate row highlighting without full blown

I'm trying to accomplish simply adding a css class to a div on alternate rows in my without going to the overhead of including a full blown which will force me to keep a lot of markup in sync in the…
Kieran Benton
  • 8,739
  • 12
  • 53
  • 77
55
votes
8 answers

Default text for empty Repeater control

Using VS 2008, I have a Repeater control:
AGuyCalledGerald
  • 7,882
  • 17
  • 73
  • 120
43
votes
4 answers

Nested Repeaters in ASP.NET

I have a class that contains hierarchical data. I want to present this data in my ASP.net webapp using nested repeaters. How do I do this? I've only ever done one level of nesting, how do I do say five levels? Each item can have zero or many sub…
Mike
  • 443
  • 1
  • 4
  • 7
43
votes
6 answers

Repeater in Repeater

I have a repeater inside a repeater. Where the parent repeater is bound to a Datatble which has a column with a Datatable in it. I would like to bind the child repeater to the datatable column in the parent repeater's datarow Is this possible? i was…
bill
  • 905
  • 5
  • 10
  • 21
41
votes
4 answers

Bind dictionary to repeater

I have a dictionary object and would like to bind it to a repeater. However, I'm not sure what to put in the aspx markup to actually display the key-value pair. There are no errors thrown and I can get it to work with a List. How do…
XSL
  • 2,965
  • 7
  • 38
  • 61
38
votes
4 answers

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control

I am getting the following error Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. but all I am trying to do is inside a ASP.NET REPEATER Control <% if ( Eval("Message").ToString() ==…
Dan
  • 383
  • 1
  • 3
  • 4
36
votes
4 answers

Binding a generic list to a repeater - ASP.NET

I am trying to bind a List to a repeater. I have converted the list into an array by using the ToArray() method and now have a array of AreaField[] Here's my class hierarchy public class AreaFields { public List Fields { set;…
DotnetDude
  • 11,617
  • 35
  • 100
  • 158
36
votes
7 answers

Strange Error - CS0012: The type x is defined in an assembly that is not referenced

The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'. I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the…
Mike T
  • 415
  • 2
  • 5
  • 9
33
votes
4 answers

How can I loop through Items in the Item Template from an asp:Repeater?

I have a repeater, which is bound on preRender with items. In the Item template each row has a check box. This works fine. I'm trying to loop through all the checkboxes in the item template after it has been bound. Is there any way of doing this?
Funky
  • 12,890
  • 35
  • 106
  • 161
30
votes
10 answers

Formatting DataBinder.Eval data

How can I format data coming from a DataBinder.Eval statement in an ASPX page? For example, I want to display the published date of the news items in a particular format in the homepage. I'm using the ASP.NET 2.0 Repeater control to show the list of…
Nahom Tijnam
  • 4,726
  • 5
  • 25
  • 25
30
votes
10 answers

asp.net radio button grouping

I am currently having an issue with radio buttons and grouping. I have an asp radio button within a repeater control. I have the group name attribute set to "Customer". When the page loads, the radio buttons are not grouped. Instead of the id fields…
fizch
  • 2,599
  • 3
  • 30
  • 45
26
votes
3 answers

How to access datasource fields in an ASP.NET Repeaters ItemDataBound event?

I have a Repeater control that is being bound to the result of a Linq query. I want to get the value of one of the datasource's fields in the ItemDataBound event, but I'm not sure how to do this.
Peter
1
2 3
99 100