All entries for Friday 31 March 2006
March 31, 2006
Writing about web page http://www.gotdotnet.com/workspaces/workspace.aspx?id=ccbb6b50-6c55-4291-b191-f5c5f80ba122
I've been doing more work on the BindingListView
A problem I faced was when displaying a master-details style UI. I could make the master list a BindingListView (with filtering, sorting, etc) but then the child "details" list would just be whatever the business object had defined it as e.g. List
While the business object developer could add an additional property that exposed a BindingListView of a list, that violates the separation of business logic and UI logic. (Since a view is really only for the UI's benefit.)
The solution was to make the view object provide additional properties at runtime using its ITypedList interface implementation. Basically, it looks for properties that implement generic IList and then returns additional properties for a BindingListView of those. The actual view objects are stored in the EditableObject
So I can now set the DataMember of a child bindingsource on my form to something like "OrderView". This is the provided view of the "Orders" list.