I have an arraylist arrTotalItems of class Operation.Operation.
the class has two properties one is ID and name.
Now I have other arraylist arrSelectedItems which contain ID of operations
Now I have to bind two DataList to name of operation.
First DataList will be bind to selected arraylist.
Other DataList will be bind to arrTotalItems - arrSelectedItems that is those operations that are not in arrSelectedItems.
not able to find the logic how to bind both the lists
If you’re using version 3.5 or higher of the .NET Framework, LINQ allows you to project operations from the ids stored in
arrSelectedItemswith Select(), then use Except() to compute the intersection betweenarrTotalItemsand this projection:Note you first have to apply
Cast<T>()to yourArrayListsin order to obtain instances ofIEnumerable<T>that can be used with LINQ methods.