Datagrid w/ CSLA 1.5

Datagrid w/ CSLA 1.5

Old forum URL: forums.lhotka.net/forums/t/2307.aspx


RichardW posted on Thursday, February 08, 2007

I'm using CSLA 1.5 w/ Net 2.0 and a datagridview w/ an Editable Root Collection object w/ Editable Child objects.  I'm setting the value of two other properties based on one property in the EditableChild.  The problem is that is will not update the grid. 

 

Thanks Richard

RockfordLhotka replied on Friday, February 09, 2007

Are you using the old-style binding or a bindingsource? Not that I know exactly what difference that might make, but it could narrow the scope a bit. It is possible that the .NET 2.0 binding doesn't fully support the propertyChanged event concept from .NET 1.x now that there's an actual PropertyChanged event available.

(disclaimer: I haven't tried what you are doing - I spent very little time with CSLA 1.x on .NET 2.0...)

One thing you might consider, is altering the code in BindableBase to raise an actual PropertyChanged event rather than the IsDirtyChanged (or in addition?), so as to tap into the new data binding technology more effectively. I don't know if that'd solve it, but it might.

To get comparable behavior to IsDirtyChanged, you'd want to raise PropertyChanged with a property name of "" - thus causing a global refresh, just like you got in .NET 1.x with IsDirtyChanged.

RichardW replied on Wednesday, February 14, 2007

Rocky - thanks for the reply and sorry it took so long for me to reply back.

Regarding 1.5, I was using bindingsource.

I decided to go ahead and upgrade to CSLA 2.1.3 and get the 2005 book.  I wish I had done so earlier! <g>  That fixed the binding problem.

 Even though the AddNewCore method in the collection basically does the same thing as 1.5 OnAddNew method, the grid doesn't seem to recognize it - there's no blank line at the bottom of the grid.  CanAddObject is set to true.

Thanks Richard

 

 

 

RockfordLhotka replied on Wednesday, February 14, 2007

You do need to set AllowNew to true in the constructor so the collection can tell data binding it supports the add new concept.

 

Rocky

 

Copyright (c) Marimer LLC