StrataFrame Forum

Design Time problem with Complex Business Object

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

By Ertan Deniz - 4/1/2008

I have an complex Business Object called Companies with a property called rGroups. "rGroups" is also a business object. When I dropped complex Business Object on the form , I 've got the error msg in attached file.
By Edhy Rijo - 4/2/2008

Hi Ertan,

Based on your error, the rGroups BO is doing something that requires the CurrentRow to exist, since that is not the case "CurrentRowIndex: -1" then you get the exception.

Put some validation in your code to check for the BO.Count > 0 to avoid this kind of error.

By Ertan Deniz - 4/2/2008

I've got the error at the design time.
By Edhy Rijo - 4/2/2008

I assumed that you have added the custom property to your BO to handle your needs, then that code may be the one triggering the error when the BO is dropped on the form.  If that is the case could you please post the code you added to your BO to help us out identifying this situation?
By Trent L. Taylor - 4/2/2008

You need to probably test whether you are in design mode or not.  Also, you need to ensure that this object is created prior to be evaluated.  First, to determine if you are in design mode or not, use the Me.DesignMode property:

If Not Me.DesignMode Then
    '-- Place your logic here
End If

Secondly you have something that evaluating the property probably before it has been created.  This is not a complex property by any means, it is just a simple property exposing another BO.  So be sure that it has been set to a value prior to evaluation and do not let it be evauluated (at least the internal properties) at design-time if an object has not been set.

By Ertan Deniz - 4/2/2008

Thanks.

I've checked DesignMode and null value.