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 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.

- 3 comments by 1 or more people Not publicly viewable

  1. Marco

    Thanks for this great control.Trying to learn c# so bear with me.
    I will go to the point.
    I m trying to inherit from bindingListView but I get
    no overload for method "BindingListview" takes 0 arguments"
    Inheriting from AggregateBindingLIstview is ok.
    I know you have added a constructor and it's likely to do with it ,but i cannot figure out how.

    Also you say
    "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"

    I have looked in your example that comes with it and you dont use it.
    Should I use it?

    Great bindinglist and good example.
    Thanks for your time.

    07 Nov 2005, 08:57

  2. _JERKER_


    Have tested the BindingListView after having it recommended by someone else. And, if I’m right, the AggregateBindingListView supports showing information form many source lists.

    However, what I would like to have is a ListViewer that supports filtering against a common source list. I have tried using two instances of BindingListView against the same source list, but they are interfering with eachother…

    Have you ever heard of a ListViewer with these capabilities, or is there a potential feature request?


    29 Sep 2006, 12:49

  3. The following code works fine for me.

                BindingList source = new BindingList();
                source.Add(new Person("Foo", "Bar"));
                source.Add(new Person("Tset", "Case"));
                source.Add(new Person("Killer", "Instrinct"));
                BindingListView view1 = new BindingListView(source);
                BindingListView view2 = new BindingListView(source);
                dataGridView1.DataSource = view1;
                dataGridView2.DataSource = view2;

    What are you trying to achieve?

    01 Oct 2006, 18:30

Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

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


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


Blog archive

Not signed in
Sign in

Powered by BlogBuilder