Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Problem with bound TMultiLineEdit
Wed, Nov 14 2018 6:36 AMPermanent Link

ooptimum

I ran into another problem, which I think is also related to a bug in the runtime library. If there is a text field in a dataset and a multiline edit control is bound to this field, the Lines.Count of this multiline edit is zero after opening this data set, although the data is displayed correctly. Is there any workaround to solve this problem?



Attachments: demo.zip
Wed, Nov 14 2018 6:38 AMPermanent Link

ooptimum

I could not attach two files at once. Here is an illustration of the problem.



Attachments: question.png
Wed, Nov 14 2018 7:52 AMPermanent Link

ooptimum

Most likely, the described problem is related to the fact that TGrid.OnRowChanged is fired before the TMultiLineEdit has time to get its data. It is easy to check. If after loading the dataset you do not change the current line and check the value of the TMultiLineEdit.Lines.Count again, the correct value will be obtained. But why does this problem manifests itself only in the very first call of TGrid.OnRowChanged? Is this related to asynchronous nature of communications with a server? Is TGrid.OnRowChanged first time called before its bound dataset is fully loaded?
Wed, Nov 14 2018 1:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< Most likely, the described problem is related to the fact that TGrid.OnRowChanged is fired before the TMultiLineEdit has time to get its data.>>

Yes, that case is that the TGrid is notified *before* the TMultiLineEdit control, therefore its OnRowChanged event occurs before any changes actually occur in the TMultiLineEdit.

<< But why does this problem manifests itself only in the very first call of TGrid.OnRowChanged? Is this related to asynchronous nature of communications with a server? Is TGrid.OnRowChanged first time called before its bound dataset is fully loaded? >>

The TGrid.OnRowChanged event can get fired for various reasons.  In the first case, it is getting fired due to the dataset getting loaded, whereas in subsequent cases it is the navigation that is causing the OnRowChanged event to fire, hence the difference.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Nov 14 2018 2:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Actually, I've been doing some more thinking on this, and the two situations *should* result in the same notifications, etc., so I'll doing some more debugging and see what's going on.

Tim Young
Elevate Software
www.elevatesoft.com
Image