All entries for Saturday 22 October 2005

October 22, 2005

AggregateBindingListView

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 project . The extension is that now multiple source lists of items can be merged into a single view. This view can then be sorted, filtered and searched.
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 does just that!

The plain old BindingListView is infact a degenerate case of the aggregate class, i.e. has just one source list of items. I have therefore now made it simply inherit from AggregateBindingListView and add an additional constructor that takes the list to view.

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 automatically sets that property in the constructor, so no changes needed there.)

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.


Music this week

This week, I 'ave been mostly listenin' to Lamb – Best Kept Secrets

Google Ads

Search this blog

Most recent comments

  • I scratched my eye while i was holding some kind of plastic packaging.. Anyways the corner of the pl… by Ercan on this entry
  • About a year ago my contacts that i was wearing, i guess were fautly, because shortly after they wer… by Jon on this entry
  • I got shower gel in my eye 4 and a half days ago, and becasue i rubbed my eyes a lot, i have scratch… by Chris on this entry
  • This website may help http://www.webmd.com/eye–health/tc/Eye–Injuries–Home–Treatment by S on this entry
  • I somehow got dirt, or debris in my eye. The terrible pain sent me in a tailspin. I was afraid of sa… by Bobbi on this entry

Tags

October 2005

Mo Tu We Th Fr Sa Su
Sep |  Today  | Nov
               1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31                  

Galleries

Blog archive

Loading…
Not signed in
Sign in

Powered by BlogBuilder
© MMXIV