How to filter data from observableCollection by a condition.
hi all,
i have observablecollection to maintain records. need filter records per matching condition records, , records need push in observablecollection.
i have tried it, not working properly, not giving filtered records, giving records have main collection.
please me out.
hi,
well, example. assuming getrecords returns collection, , class in question called record , has datetime property called dateordered, following records ordered in last 5 days.
using system.linq; ... observablecollection<record> source = getrecords(); observablecollection<record> filtered = source.where(r = > r.dateordered > datetime.now.adddays(-5));
hope helps!
regards,
rob
Silverlight > Silverlight Controls and Silverlight Toolkit
Comments
Post a Comment