Code-Based Filtering in ObjectListView

Posted on December 17, 2006

Note: You can download the complete implementation here. In previous posts, I presented ObjectListView, my implementation of a DataView-like class for arbitrary business objects. It allows you to bind a DataGridView (and other controls) to an IList of your choice. As an IBindingListView implementation, ObjectListView supports the Filter property, which allows you to filter the underlying list to present only the items that match the filter ...

Read More


Custom sorting in the DataGridView

Posted on December 10, 2006

How do I control the sort order for a column in the DataGridView? This question comes up when the "natural" order of the sorted data is at odds with the user's expectation.  Let's say that you have a customer table with a customer program column.  This column indicates the customer rewards level for a loyalty program.  For our example, the possible values might be: None Silver Gold Platinum If these values are represented as ...

Read More


ObjectListView Update (1.0.0.3)

Posted on December 3, 2006

Note: You can download the complete implementation here. Stable Sorts Pat Dooley asked about making the ObjectListView sorting mechanism stable, an excellent point.  This means that list items with sort keys that compare as equal should appear in the same order each time for a given sort.  Pat also provided a sample implementation, so I took up the challenge this weekend, and voila: stable sorts. Since ObjectListView never alters the ...

Read More


ObjectListView Demo: Master/Details

Posted on December 3, 2006

In the latest release of ObjectListView, I included a new demo that illustrates some fine points in real-world data binding with DataGridView.  Namely, binding a list (in this case our ObjectListView) to the grid and binding the current list item (i.e. current grid row) to some other data entry controls.  I also wanted to show how to manage the current grid row position as the list is sorted, and how to do multiple column sorts with the ...

Read More


DataView for Objects: Final Cut

Posted on November 19, 2006

Note: You can download the complete implementation here. In my last post I described the implementation of IBindingListView interface in ObjectListView, my implementation of a view for collections of arbitrary objects.  This was the last interface needed to support binding to controls such as the DataGridView. In this post, I'll show some sample code that demonstrates the use of ObjectListView. The Demo I'm going to display data ...

Read More