StrataFrame Forum

ChildAutoFilterOption not working

http://forum.strataframe.net/Topic18856.aspx

By Chan - 8/30/2008

Hi,

I have problem as above. Any ideas?



I have attached sample project that using latest SF library.



Thank you
By Chan - 8/30/2008

Hi,

After some debugging, I found that, when ChildBO.Add() called, ChildBO.Filter is always "1=0" even thought ParentBusinessObject is set. It cause error when I try to set default value.



Any ideas? Urgent!



Thank you
By Chan - 8/30/2008

Hi,

One thing very strange is, in BO.NewRow(), _CurrentRowIndex is always -1 even thought lnRowIndex which is 0 has been assigned to it.



'-- Set the row index to the index of the new row

_CurrentRowIndex = lnRowIndex
By Edhy Rijo - 8/30/2008

Hi Chan,

I have not seen your posted sample project, but I do know that when you are using any filter and you are adding records, you should set the filter off before adding then re-add the filter after adding.

There are several post related to this issue in the forums, do a search using the Filter keyword and you will find better explanations and sample code for this kind of issue.

By Chan - 8/30/2008

Hi,

Thank you for reply.



In fact, I don't explicitly set Bo.Filter. I just let SF to manage it.

What I want is, since my ChildBO.ParentRelationship and ParentBO.ChildAutoFilterOption have been set, it should auto filter relavent records for me.
By Edhy Rijo - 8/30/2008

Hi Chan,

I don't remember all the details about ChildAutoFilterOption, but search the forums using "ChildAutoFilterOption" and you will find messages about this.

By Chan - 8/30/2008

Hi,

I have solve this by calling FilterChildRecords() after every ParentBO.Add() called. I found that in SF source code, FilterChildRecords() only been called in Save(), SaveByForm(), ChildAutoFilterOption setter method, Filter setter method and Navigate().



Why doesn't it been called in Add() and DeleteCurrentRow()?



Please advice.

Thank you