C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




RepeaterItem in the Repeater control


Posted Date: 15 May 2008    Resource Type: Articles    Category: Web Applications
Author: Ramasamy.NMember Level: Gold    
Rating: Points: 10



RepeaterItem Represents an item in the Repeater control.

The Data items of the Repeater control are stored in a RepeaterItemCollection object that can be accessed by using the Items property of the Repeater control.



For example


foreach(RepeaterItem item in Repeater1.Items)
{
// here Repeater1.Items represents RepeaterItemCollection. //That is collection of RepeaterItem.

((DataBoundLiteralControl)item.Controls[0]).BackColor = System.Drawing.Red;

//item.Controls[0] represents first column of each row in the Repeater control.

}


ItemType

Gets the type of the item in the Repeater control.

Syntax

public virtual ListItemType ItemType {get; }

se the ItemType property to determine the type of an item in the Repeater control. The following table lists the different item types.
Item Type Description
Header The heading section of the Repeater control.

Footer The footer section of the Repeater control.

Item An item in the Repeater control.

AlternatingItem An alternating item in the Repeater control.

SelectedItem The selected item in the Repeater control.

EditItem The item selected for editing in the Repeater control.
Separator A separator between the items of the Repeater control.
Pager The page selection section of the Repeater control.








Label1.Text = "The Items collection contains:
";

foreach(RepeaterItem item in Repeater1.Items)
{
Label1.Text += item.ItemType + " - " +
((DataBoundLiteralControl)item.Controls[1]).Text +
"
";
}

[code/]
ItemIndex

Gets the index of the item in the Repeater control from the Items collection of the control.

DataItem property

Gets or sets a data items associated with the RepeaterItem object in the Repeater control.





Responses

Author: Mahesh Raj    07 Jun 2008Member Level: Gold   Points : 1
This is very good information,Continue posting such useful articles.


Author: John Fernandez    08 Jun 2008Member Level: Gold   Points : 1
Very well written Article.Thanks for sharing this information.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: PagedDataSource Class For Paging
Previous Resource: ASP.Net State Server Management in Webfarm and WebGarden
Return to Discussion Resource Index
Post New Resource
Category: Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use