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


Off to DevConnections

Posted on November 5, 2006

And not a moment too soon - the rain has come to Portland.  My tentative schedule: Monday Registration Keynote Schmoozing Tuesday Vista and Office 2007 Top 10 ways to light up your apps on Vista Window Vista Tips and Tricks Intro to .NET 3.0 Vista for Managed Developers Wednesday Basics of WPF Multithreading in .NET 2.0 Layout and Navigation in WinForms Generics Too close to call - Writing Reliable Code ...

Read More