Omiting a record from a bound control (ASP Repeater)

A

AC

I have an ASP Repeater control I'm using to display data. The data source I'm binding to the control contains more records than what I want do display in my repeater (I'll explain why in a second). I've tried catching the various events (OnItemCreated, OnItemDatabound, OnPostCreated) to check if the item is to be displayed or not. That does work, but the content wtihin the ItemTemplate tags in my repeater that aren't ASP.NET controls are still output (there's a HR and elipses in there). Is there a way to catch an event BEFORE when the item is bound to the current Repeater iteration, but BEFORE it renders the inner HTML of the ItemTemplate.

Why don't I just select the needed records from the DB before I bind the datasource? The datasource is a custom collection from MS's Content Management Server 2002 (PostingCollection). I can't filter it based on what I need... I can only sort and grab the entire collection.

My only other option is to iterate through the PostingCollection, stuff the ones I want into an array, and then bind the array to the Repeater... not very desireable though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top