Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove a DataItem from a list with the RepeaterItemEventHandler event

Status
Not open for further replies.
Jun 9, 2006
159
US
How do I stop from adding this item while examing each item in a repeater control through the RepeaterItemEventHandler event handler?

Code:
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            // skip if the album is empty
            System.Data.DataRowView drv = (System.Data.DataRowView)(e.Item.DataItem);
            int imageCount = int.Parse(drv.Row["ImageCount"].ToString());

if(imageCount == 0)
// SKIP?! 

...
}

Thank you!


Shawn Molloy
Seattle, WA
 
The easiest way would be to filter out the rows you don't want using the sql you use to get the data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top