Specify fixed size for business list?

Specify fixed size for business list?

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


pearljam posted on Wednesday, August 28, 2013

Is there a way to specify the size of a business list on creation? I have a business list that when created has some attributes pulled out of a config file. One of those attributes is a flag indicating that it should be fixed length. So if the attribute specifies 20 for a length, I need to be able to say that the min and max length is 20, so no adding or removing of items. Is this easy to do?? Thanks in advance!

JonnyBee replied on Wednesday, August 28, 2013

Hi,

The short answer is NO.

I would recommend to create your own base class that derives from ReadOnlyListBase / ReadPnlyBindingListBase and implement the necessary interfaces to be used in the same manner as BusinessListBase.

Basically you need to implement the Csla.Core.ITrackStatus interface and additionally the Child_Update method if you use DataPortal_XYZ for DataAccess.

With a read only list you load the fixed number of items and after this the collection is ReadOnly so no items can be removed or added.

 

 

Copyright (c) Marimer LLC