johnllao

August 19, 2008

Using CSLA FilteresBindingList

Filed under: Uncategorized — johnllao @ 10:25 am

The example below show a simple way to filter a CSLA object collection using the FilteredBindingList.

CountryReadOnlyCollection list = CountryReadOnlyCollection.GetList();
FilteredBindingList<CountryReadOnly> f = new
    FilteredBindingList<CountryReadOnly>(list);
f.ApplyFilter("Code", "PH");
Trace.WriteLine(string.Format("Total Count: {0}", list.Count));
Trace.WriteLine(string.Format("Filter Count: {0}", f.Count));
Trace.WriteLine(string.Format("Name: {0}", f[0].Name));
Trace.WriteLine(string.Format("Currency: {0}", f[0].Currency));

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Create a free website or blog at WordPress.com.