Clientdataset.Disablecontrols is safe?

Asked

Viewed 893 times

1

In a simple routine to feed a Clientdataset, first execute the command ClientDataSet.DisableControls (before the try) and at the end of while (in the finally), execute the command ClientDataSet.EnableControls.
But the problem is that the controls of Clientdataset are not entitled to EnableControls.
I realized that if I perform more often in the sequence the EnableControls, then yes the controls are restored.

Searching the web, I saw that this problem is not new.
http://www.tek-tips.com/viewthread.cfm?qid=203983

Anyway, I want to know:
It’s safe to use the DisableControls/EnableControls?
Is there some detail needed for these commands to work, or is it really another bug delphi?

1 answer

3


I’ve been working with Delphi for 12 years, we’ve migrated the company Software from Delphi 5 to the newest IDE and we’ve never, I mean, never had a problem with this!

The utility here is that when disabling the controls the user does not notice when we traverse a DataSet, without it, I give an example of a Grid, it is noticeable when you place the Dataset in some record, or when you go through it.

Source Internal IDE XE10.2.2 documentation:

Data.DB.TDataSet.EnableControls Re-enables data display in data-Aware Controls Associated with the dataset.

Data.DB.TDataSet.DisableControls Disables data display in data-Aware Controls Associated with the dataset.

That is, extremely harmless, because it is only the display of the data.

Enablecontrols

Disablecontrols

  • I did notice a problem in the routine, the DisableControls was inside a while, whereas the EnableControls was out... DisableControls before the while (had not realized due to the complexity of the routine and because there was more than one loop in it).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.