Alternating item template repeater control


















Properties and events of the Repeater control Property or event name Description AlternatingItemTemplate property Gets or sets the alternating item template Controls property Gets the ControlCollection object containing all the child controls DataMember property Gets or sets the specific table in the DataSource to bind to the control DataSource property Gets or sets the data source FooterTemplate property Gets or sets the footer template HeaderTemplate property Gets or sets the header template ItemCommand event Fired when a button is clicked ItemCreated event Fired when an item is created ItemDataBound event Fired after an item is databound but before it is rendered Items property Gets a collection of repeater item objects PreRender event Fired when the control is about to render its containing Page object SeparatorTemplate property Gets or sets the separator template.

Templates supported by the Repeater control Template Description Get it now. AlternatingItemTemplate property. Gets or sets the alternating item template.

Controls property. Gets the ControlCollection object containing all the child controls. DataMember property. Gets or sets the specific table in the DataSource to bind to the control. DataSource property. Gets or sets the data source. FooterTemplate property. Gets or sets the footer template. Contains the elements to render between each item. A typical example might be a line using an hr element. For more information, see ASP.

The Repeater control must be bound to a data source. Alternatively, you can bind a Repeater control to any class that implements the IEnumerable interface, which includes the ADO. When binding data, you specify a data source for the Repeater control as a whole. When you add controls to the Repeater control — for example, when you add Label or TextBox controls in a template — you use data-binding syntax to bind the individual control to a field of the items returned by the data source.

The following example shows an ItemTemplate that contains a data-bound Label control. You cannot bind controls in the header, footer, and separator templates using the Eval data binding function.

If you have controls in these templates, you can simply define their properties statically. The Repeater control supports several events. One of them, the ItemCreated event, gives you a way to customize the item-creation process at run time. The ItemDataBound event also gives you the ability to customize the Repeater control, but after the data is available for inspection. For example, if you were using the Repeater control to display a to-do list, you could display overdue items in red text, completed items in black text, and other tasks in green text.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 12 years, 1 month ago. Active 5 years, 3 months ago. Viewed 11k times. Any suggestions much appreciated! The code I use is this: if jQuery " articleList1". Steven Steven Thanks for all the good feedback guys. It will help me in other cases! Add a comment. Active Oldest Votes. Item e.

FindControl "row" as HtmlTableRow; if row! Rippo Rippo 21k 13 13 gold badges 70 70 silver badges bronze badges. My container doesn't have a ItemIndex : — Steven. That is really sweet and simple. Never occurred to me. Care to give me a push in right direction of finding the control? I'm not that. NET savvy : — Steven. Show 2 more comments.



0コメント

  • 1000 / 1000