views:

121

answers:

1

In onItemDataBound event of the ListView I am checking the data and under certain condition I dont want this item to be part of the DataList. If I make it invisible it will still be accounted for in DataList. It will just be invisible and the sepatators and its place in tilibg will still be there.

Is there way to exclude the item from DataList like it never existed in the datasource?

Thanks,

Dragan

+2  A: 

You may want to work directly with the datasource to remove the items (may at the Selected) event from the datasource before passing it to the data list... other wise you end up with the problem you mention along with others (counting, paging, etc.)

Jaime
I am using SiteMapDataSource and cannot change anything there.
If you need to use the sitemapdatasource, you may need to create a custom sitemapprovider to do the filtering for you... where are you getting the data from? a web.sitemap?
Jaime