abilwd
10/28/2008 11:46:00 AM
I think you may consider storing the ?°removed?± status of each DataListItem
in the DataList class, and over-writing DataList?¯s GetEnumerator function.
In the function, we go through each element of the list, check its
?°removed?± status, and ?°yield?± the element if its status is not
?°removed?±.
"Peter Larsen [CPH]" <PeterLarsen@community.nospam> wrote in message
news:uSKEDiNOJHA.240@TK2MSFTNGP03.phx.gbl...
> Not a bad idea - it would work - easy and simple solution.
> I'm using .Net 3,5 and LinQ in my code.
>
> I still think there must be another way to do this - something that
> includes an interface and override an enumeration method.
> It must be using an enumerator when getting the data from the datasource.
> I just don't know which.
>
> /Peter
>
>
> "wdudek" <wdudek@newsgroup.nospam> wrote in message
> news:471593BB-AE41-4BF5-AF7A-904641735EED@microsoft.com...
>> Since you have a custom class, why not create a method that returns the
>> generic list of objects which can provide the list for the data bind.
>> This
>> could then create a new copy of your source list filtered by whatever you
>> needed and return that to the calling method. Depending on the version of
>> the
>> framework you are using you could do this through a foreacch loop, or
>> much
>> cleaner using LINQ.
>>
>
>