All 8 entries tagged Data Binding
No other Warwick Blogs use the tag Data Binding on entries | View entries tagged Data Binding at Technorati | There are no images tagged Data Binding on this blog
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.
November 19, 2005
Here's the second screen cast
It shows off the more advanced features of the Data Bound Tree View control. These include binding to a recursive data structure, automatic node reordering upon source list sorting and dynamic custom node creation.
Check it out and let me know what you think!
November 17, 2005
Writing about web page http://www.equin.co.uk/screencasts/01-databoundtreeview.wmv
I decided that trying to write about the projects I've been working on would take too much time and not really get across the ideas as easily as just showing you! Therefore I decided to have a go at a "screen cast".
This first video demos the basics of my new Data Bound Tree View control. I'm still playing around with recording settings, etc, so hopefully the quality will improve for the next one.
Any comments, suggestions are welcome.
November 08, 2005
I decided that my data bound treeview control should support recursive data structures. For example an OPML file consists of a set of "outline" elements and each outline can have child outlines inside. Therefore I've added a method to the control called "AddRecursiveLevel". So the tree will then recurse over the data structure until all leaves have been reached. The recursive level cannot have a CurrencyManager to update because that would require changing the data source of it (which can't be done easily). It does not make much sense to have an idea of "currency" when dealing with arbitrary depth tree data structure. The solution is to add a SelectedDataItem property to the control. Code that uses the treeview control can data bind that property to the datasource property of a BindingSource component. Other UI controls can then bind to that BindingSource. That way the user can drill down to a node in the tree view and then edit data using controls bound to the selected item.
There is still a fair bit of work to do in terms of enforcing constraints and documentation. I'm very busy getting ready for my trip to the USA on Thursday. Hopefully when I return I will have some more free time to work on the control.
October 27, 2005
October 22, 2005
Writing about web page http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=ccbb6b50-6c55-4291-b191-f5c5f80ba122
It took an afternoon of coding (and about a day or so of background thought process from the past month), but I finally created a working data-bindable aggregate object list view class. It grew out of the BindingListView
An example of where this is useful would be an RSS feed reader application. Here you would want to show a single feed's list of items and also allow the user to view all items from all feeds. The user should be able to sort the items and search, etc, even when viewing all items from all feeds. The AggregateBindingListView
The plain old BindingListView
One special point for people using the ABLV class, the "NewItemsList" property must be set before items can be added using UI controls like the DataGrid. That way the ABLV knows which list to add the new item to. Otherwise adding new items in that way is disabled. (BindingListView
I'm very happy with the code and have put together a simple RSS reader application to test it. More testing is required, since the concept of merging multiple lists and keeping things like additions, edits, deletes in sync is by no means straight forward. I also need to complete/update the XML documentation. A further addition to the library would be a class to parse SQL style filter predicates. (We already have a SQL sort property implemented.) This is a fair amount of work, but would allow things like:
view.ApplyFilter("Name LIKE 'A*' and Age >= 18")
Currently only coded filters (classes that implement IFilter) exist.
Any interested coders are welcome to join the GotDotNet workspace linked above.
September 17, 2005
So now the business object is in control of business rules and the RuleRinder takes care of setting the relevant UI. Thus eliminating all those TextBox.Validated event handlers.
If I get the code commented up properly (when I'm less busy) I'll post it online. It looks like I'm building up a fair amount of code here for a rather nice "Data Binding Framework" library.
September 02, 2005
Has anyone seen aggregate lists anywhere before?
What I mean is given multiple of lists of a business objects (of the same type), I want to have a list that contains all the objects from all the lists. Of course I require any changes in the source lists to be reflected in the aggregate list.
I've done some quick Googling, but found nothing in this area.
I may extend my BindingListView
Example of use:
Say I have 10 Customer objects and each customer has a list of Order objects. I want a form that displays all the orders from all customers (and lets me filter/sort the data). I don't really want to have extra code and queries that pull back a separate list of orders, since I want changes made to be put into the actual Customer's order item.
So an aggregate list of the existing Order lists would work great.