IsSavable not getting updated when doing changes in Child Rows in Grid

IsSavable not getting updated when doing changes in Child Rows in Grid

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


Vinodonly posted on Sunday, November 05, 2006

As in the tracker sample my save button Enabled button is set to IsSavable

If i'm doing changes in the parent fields then property is getting updated but doing changes in child rows avl in grid is not refreshing this property.

Can anybody help in this.

Bayu replied on Sunday, November 05, 2006

Make sure that you override IsDirty and IsValid to also include the child collection in order to determine dirtyness and validity:

    Public Overrides ReadOnly Property IsDirty() As Boolean
        Get
            Return MyBase.IsDirty OrElse <ChildCollection>.IsDirty
        End Get
    End Property

    Public Overrides ReadOnly Property IsValid() As Boolean
        Get
            Return MyBase.IsValid AndAlso <ChildCollection>.IsValid
        End Get
    End Property


Bayu

Vinodonly replied on Sunday, November 05, 2006

Thanks for your reply.

Kindly note that this code is already set as i copied it as it is from Tracker source and just changed the Business Object names

In Tracker source, this code block is only given in parent object and i have done the same assuming that child collection and child object will return results automatically but that is not happenning..

 

 

 

Bayu replied on Sunday, November 05, 2006

Allright ....

In that case I'm not so sure

I do know there was an issue that could be resolved by using some BindingRefresh component or so (see also the PTracker). I have no experience with this since I never faced the issue (yet).

Hopefully someone with more relevant experience comes to the rescue. ;-)

Bayu


Vinodonly replied on Monday, November 06, 2006

i found the solution myself and i'm posting it here so if anybody else is facing this problem then he can try this...

 

There were 2 binding source, one for child and one for parent. I was only updating the save status on parent binding source -> CurrentItemChanged, now i'm also updating save status in Child binding source-> CurrentItemChanged and problem is solved.

Copyright (c) Marimer LLC