CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • IBindingList support and DevExpress Grids

    rated by 0 users
    Answered (Not Verified) This post has 0 verified answers | 9 Replies | 3 Followers

    Top 200 Contributor
    46 Posts
    mattruma posted on Thu, Aug 19 2010 1:25 PM

    I'm running into a problem where I can't get my collection to fire the AddNew from my DevExpress Grid ... I think the problem is because the DevExpress Grid supports collections that implement IBindingList (which prior to CSLA 4.0, the BusinessListBase did implement) ... the CSLA 4.0 BusinessListBase no longer implements this interface.

    Any ideas on what to do?

    All Replies

    Top 10 Contributor
    2,279 Posts
    Suggested by JonnyBee

    In Csla4 use BusinessBindingListBase - in essence the csla 3.8.x  BusinessListBase has been renamed to  BusinessBindingListBase and implements the IBindingList interface.

     

    Jonny Bekkum, Norway CslaContrib Coordinator

    Top 500 Contributor
    21 Posts
    dmnc replied on Fri, Aug 20 2010 4:44 AM

    I'm having problems getting the WPF DataGrid to allow the user to add new rows when using BusinessListBase. It seems that only IBindingList exposes the AllowNew property. The concept of adding new items to a collection still exists in CSLA 4 though.

    Do I have to replace BusinessListBase with BusinessBindingListBase to support adding new rows in a DataGrid?

    Top 200 Contributor
    46 Posts

    Hmmm ... didn't know that! Smile

    So when should you class inherit from BusinessListBase verses BusinessBindingListBase? They are both still available.

    Top 25 Contributor
    422 Posts

    BusinessBindingListBase is intended to support the "legacy" UI technologies (e.g. WinForms) that require IBindingList, as it inherits from BindingList<T> (which implements IBindingList).  BusinessListBase is intended to support the newer UI technologies (WPF/SL), and it inherits from ObservableCollection<T>.

    Which collection base class you use depends on what data-binding technology your UI supports.  WinForms only knows about IBindingList, WPF only partially supports IBindingList<T> (but fully supports ObservableCollection<T>), and Silverlight only knows about ObservableCollection<T>.  Because of these discrepancies, Rocky created the second inheritance hierarchy in CSLA 4.

    HTH

    - Scott

    Top 10 Contributor
    9,475 Posts

    mattruma:

    So when should you class inherit from BusinessListBase verses BusinessBindingListBase? They are both still available.

    It is a sad situation Microsoft and the datagrid vendors have created. When Microsoft decided that WPF wouldn't fully support IBindingList that was fine - we all felt that switching to ObservableCollection was inevitable.

    But of course there are huge numbers of applications out there that rely entirely on the DataSet/DataTable/TableAdapter model - and those objects are entirely IBindingList-based. So there's a lot of pressure (I'm sure) on the datagrid vendors to make sure people can keep using their existing data objects with WPF datagrid controls.

    So the datagrid controls support the older (essentially legacy) interface model, while the rest of WPF doesn't fully support that model.

    This leaves us, as WPF users, in a nasty spot, where we have to choose the collection type we use based on the UI control set that is being used.

    My recommendation? Switch to Silverlight where there is no IBindingList to cause confusion. And I'm only half-joking when I say that - Silverlight is just a simpler world because it doesn't have this legacy crap to deal with like WPF...

    Rocky

    Top 500 Contributor
    21 Posts
    dmnc replied on Tue, Aug 24 2010 3:05 AM

    Can anyone confirm that it is only possible to let the user add new rows in the default WPF Microsoft DataGrid when inheriting from BusinessBindingListBase? I couldn't get it to work when inheriting from BusinessListBase.

    Top 10 Contributor
    9,475 Posts

    That could be true.

    I've tried continually to get the Microsoft WPF datagrid to work like the Silverlight one, and it consistently fails. I just figured the WPF datagrid was a crappy component, but maybe it just expects the use of legacy interfaces instead of the modern ones...

    The Silverlight datagrid, on the other hand, works great - it is a joy to use :)

    Rocky

    Top 500 Contributor
    21 Posts
    dmnc replied on Tue, Aug 24 2010 10:42 AM

    It's a pity, if it's really true. One the one hand you get support for adding new rows with BindingList and on the other hand you have sorting and filtering capabilities with ObservableCollection.

    Top 500 Contributor
    41 Posts
    Answered (Not Verified) vbbeta replied on Mon, Aug 8 2011 12:31 PM
    Suggested by vbbeta

    Yes you right you want be able to use BusinessListBase on a devExpress grid unless you have in the BusinessListBase class a publiConstructor because the dataBindign have no idea about a FactoryMethod and as well it can access a Private Constructor so you have to use the BusinessBindingListBase

    and while you look on this please let me know how work around on the EditLevel or BeginEdit CancelEdit on the DevExpress Grid 

     

    Page 1 of 1 (10 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems