Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi how to copy all item from two list here I am using 2 classes

cInvoice and cquotation
lstinvoice of tye cIvnoice and lstquotation of type cquotation
how to copy all item from lstIvoice to lstquotation
Posted

1 solution

It depends on what type the items are: if cInvoice contains Items that are the same (or derived from) the same class as the Items contained in cQuotation, then it is simple:
C#
myQuotation.Items.AddRange(myInvoice.Items);
If they aren't, then you will have to loop through, manually converting the items and using the Add method.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900