DataView for objects: Implementation Part I

Posted on October 10, 2006

In my last post, I described the .NET Framework support for views of collections of arbitrary objects.  In short, the required interfaces are provided, but no implementations.  In this post I'll describe what we need to do to roll our own view. In a nutshell, we need a view class that implements IBindingListView to wrap our collection of objects.  Our view will provide sorting and filtering, and neither of these operations will change the ...

Read More


DataView for objects: What’s in the box

Posted on October 9, 2006

In my previous post I made the case for having a DataView-style construct for collections of arbitrary objects.  In this post, I'll review what you can (and can't) do to achieve this with the built-in .NET 2.0 Framework classes. View vs. Collection First, why use a "view" rather than just a collection?  For the same reason we would use a DataView rather than a DataTable.  Let's say we want to present some customer data in a DataGridView ...

Read More


DataView for objects?

Posted on October 8, 2006

I've often wanted something like the DataView for a collection of my own data objects. DataView allows you to present a sorted, filtered subset of the rows in a DataTable, without actually changing the underlying table.  You can bind two DataViews of the same table to two different Windows Forms controls, using a different sort and filter in each.  Very groovy. Unfortunately, DataView only provides this goodness for the DataTable class. ...

Read More


DataSet Visualizer for Visual Studio 2005

Posted on December 12, 2005

I work with DataSets quite a bit, and I'm a fan of the DataSet visualizers that were available for VS 2003.  The DataSet QuickWatch and the XML Visualizer were two that I used a lot.  In particular, XML Visualizer allowed you to display all of the different data versions available in a DataRow. Visual Studio 2005 ships with a DataSet visualizer, but it doesn't make all of the row versions available, nor does it show the row state.  So, I ...

Read More


DataGridView: Where’s my tooltip?

Posted on December 11, 2005

If you've worked with the .NET 1.1 DataGrid control, you'll appreciate the enhanced DataGridView control of the 2.0 runtime.  I was mystified for a moment, however, when setting a tooltip on the grid failed to have any effect.  My code looked like this: DataGridView.HitTestInfo info = grid.HitTest(e.X, e.Y); if (info.RowIndex > -1) { OrdersRow row = (OrdersRow)((DataRowView)grid.Rows[info.RowIndex].DataBoundItem).Row; ...

Read More