CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

EditLevel problems with WinForms

Last post 05-22-2008, 4:20 PM by RockfordLhotka. 19 replies.
Page 2 of 2 (20 items)   < Previous 1 2
Sort Posts: Previous Next
  •  04-26-2008, 12:37 PM 23132 in reply to 22901

    RE: RE: RE: EditLevel problems with WinForms

    I’m not sure I follow what you are saying?

     

    You have something like:

     

    Person contains AddressList contains Address(*)

     

    You don’t bind Person or AddressList but you do bind an individual Address?

     

    Or you bind Person, but not AddressList, and then you do bind an individual Address?

     

    Rocky

     

     

    From: Cosmin [mailto:cslanet@lhotka.net]
    Sent: Thursday, April 17, 2008 9:58 AM
    To: rocky@lhotka.net
    Subject: Re: [CSLA .NET] RE: RE: EditLevel problems with WinForms

     

    Hi,
    Some more strange behaviour.

    What if you have a collection in the root object but you don't bind it to any bindingsource. The edit level of the first child is 2 and after applying the changes the level 1(which is wrong) and it breaks next time I begin edit.

    To fix it I just bound the collection to a hidden grid and let the binding framework do the work.

    Is this a problem in the UndoableBase class?

    Thanks,
    Cosmin



    Rocky
  •  05-21-2008, 1:20 PM 23722 in reply to 20716

    Re: RE: EditLevel problems with WinForms

    Ross,

    What do your BO's look like for your children and grandchildren. I am doing essentially the same thing you are except with an infragistics grid. When I add a child with grandchildren to the grid through code everything is fine. But, when I try to add records on the fly in the grid I get edit level mismatch on the grandchildren.

    Did you just follow the same procedures for your grandchildren as you do for child objects?

    Ryan

    tetranz:
    Yes, working perfectly. Big Smile [:D]  That's good news. I was worried that we might have to change the binding code in the UI forms again.

    My real application uses a Janus grid with the children and grandchildren in a hierarchy so there's no grandchild bindingsource and that's working fine as is a more traditional test application I have.

    Thanks
    Ross

    RockfordLhotka:

    Can you test this in your scenarios and see if it does address the issue?
  •  05-21-2008, 1:53 PM 23723 in reply to 23722

    Re: RE: EditLevel problems with WinForms

    rkelley:

    Ross,

    What do your BO's look like for your children and grandchildren. I am doing essentially the same thing you are except with an infragistics grid. When I add a child with grandchildren to the grid through code everything is fine. But, when I try to add records on the fly in the grid I get edit level mismatch on the grandchildren.

    Did you just follow the same procedures for your grandchildren as you do for child objects?

    Ryan

    Hi Ryan
    I'm not doing anything special. My form and bindingsources are as if there are no grandchildren and follow the project tracker example. I have two bindingsources, one for the root and one for the children. The children bindingsource is feed from the root in the normal way using the DataMember. The grandchildren stuff happens inside the Janus grid. The Janus designer lets me define a child table and set its DataMember to the name of the collection property on my child objects. Sorry, I don't have any bright ideas about you issue other than wonder if the Infragistics grid does something weird.

    Ross

  •  05-22-2008, 3:16 PM 23750 in reply to 23723

    Re: RE: EditLevel problems with WinForms

    I believe that my issue lies in the fact that I am using managed (propertyinfo) fields for all of my properties including child object. It looks like if I take my child objects and convert them to private backed fields then this error will go away. I am in the process of testing this now.
  •  05-22-2008, 4:20 PM 23753 in reply to 23750

    RE: RE: EditLevel problems with WinForms

    Be aware that if you use private backing fields for your child objects that you’ll have to do all the manual property and event hookups that were necessary in CSLA 3.0, because you’ll lose all the features of automatic child management.

     

    Rocky

     

     

    From: rkelley [mailto:cslanet@lhotka.net]
    Sent: Thursday, May 22, 2008 3:17 PM
    To: rocky@lhotka.net
    Subject: Re: [CSLA .NET] RE: EditLevel problems with WinForms

     

    I believe that my issue lies in the fact that I am using managed (propertyinfo) fields for all of my properties including child object. It looks like if I take my child objects and convert them to private backed fields then this error will go away. I am in the process of testing this now.


    Rocky
Page 2 of 2 (20 items)   < Previous 1 2
View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems