I have a custom descendant of TListView that I originally created in D2007, and now use it in D2010. Management worked fine on D2007 without problems, but in D2010 I experience sporadic but frequent instances in which DFM cannot be loaded with an executable file and throws an EReadError message with the message:
'Error reading lvPremiums.Items.ItemData: Stream read error'
where "lvPremiums" is the name of my TListView control. This happens when compiling in a development environment. I did not edit any properties of the control, but usually I ran the Save All command on the menu. My streaming stream list does not set any items by default; they are created at runtime.
I can fix the problem by opening the Items property from the object inspector, then immediately click OK and save the form again.
A visual inspection of the DFM file for a form that was damaged in this way shows a property declaration inside the lvPremium component:
Items.ItemData = {}
This line is missing when the form has been “adjusted” and is the current state.
By checking the source code of my TListView descendant, it does not contain the name "ItemData" and I cannot find it on the TListItems help page.
To fix this extraneous insertion in DFM, it becomes boring, as I often use this component, sometimes many times in one form.
Can anyone suggest where my problem is?
source
share