views:

168

answers:

1

I have a custom TListView descendant that I originally created in D2007 and am now using in D2010. The control worked fine in D2007 without a problem, but in D2010 I'm experiencing sporadic but frequent instances in which the DFM cannot be loaded by the executable and throws an EReadError with message:

'Error reading lvPremiums.Items.ItemData: Stream read error'

where "lvPremiums" is the Name of my TListView descendant control. This occurs when I compile in the development environment. I have not edited any properties of the of the control but generally I've executed Save All from the menu. My list view descendant does not establish any Items by default, they're created at run time.

I can fix the problem by opening the Items property from the object inspector, then immediately click OK and saving the form again.

Visual inspection of the DFM file for a form that has been corrupted in this way shows property declaration within the lvPremium component of:

Items.ItemData = {}

This line is not present when the form has been "corrected" and is a runnable state.

Checking the source code for my TListView descendant, it does not contain the name "ItemData", nor can I find this documented in the TListItems help screen.

Having to correct that extraneous insertion into the DFM is becoming a bore since I use this component frequently, sometimes many times on a single form.

Can anyone suggest where my problem lies?

+1  A: 

This has been reported in Quality Central: QC78778

Ther is also a formum thread about it here. Perhaps you can find a workaround.

Uwe Raabe
Thx. That thread contains a work around — adding a "dummy" item to each list view control, then removing it at startup.
Larry Lustig