Datasource not disabled lazarus / 16-Databases ---------------------------------------------------------------------- egsuh · 2018-08-28 03:11 Hi, I linked a DBGrid to datasource, and which is to a dataset. I set datasource.enabled to false, but the DBGrid still shows the content of the dataset. Please confirm this. Regards, ---------------------------------------------------------------------- GAN · 2018-08-28 03:45 You must close the DataSet if you want to empty the TDBgrid. I think this behavior is fine. ---------------------------------------------------------------------- egsuh · 2018-08-28 04:30 QuoteYou must close the DataSet if you want to empty the TDBgrid. I think this behavior is fine. I don't think this is fine. When I change the content of a TDataset  programatically, if there are any linked TDataSource and TDataControls, this behavior slows down the operation by large, because every change in the TDataSet must be reflected in the TDataControls. Just disabling TDataSource should prevent the content on the TDataControls from being refreshed. When the operation is finished, just enabling TDataSource would show the final result. Of course I can do this by setting TDataSource.DataSet to nil and returning to the TDataSet, but the purpose of TDataSource.Enabled property is what I'm trying to do. ---------------------------------------------------------------------- valdir.marcos · 2018-08-28 04:47 Quote from: egsuh on August 28, 2018, 06:30:06 amQuoteYou must close the DataSet if you want to empty the TDBgrid. I think this behavior is fine. I don't think this is fine. When I change the content of a TDataset  programatically, if there are any linked TDataSource and TDataControls, this behavior slows down the operation by large, because every change in the TDataSet must be reflected in the TDataControls. Just disabling TDataSource should prevent the content on the TDataControls from being refreshed. When the operation is finished, just enabling TDataSource would show the final result. Of course I can do this by setting TDataSource.DataSet to nil and returning to the TDataSet, but the purpose of TDataSource.Enabled property is what I'm trying to do.You should do this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   SQLQuery.DisableControls;  ...  SQLQuery.EnableControls; ---------------------------------------------------------------------- egsuh · 2018-08-28 05:05 Yes, I know there are many ways to achieve my purpose. I'm saying that TDataSource.Enabled is designed to that purpose, and it should be implemented because other things may depend on the TDataSource as well, not only enabling/disabling controls. For example, I may write some codes within TDataSource.OnChange event, and sometimes I do not want these to be executed. Yes, I can write TDataSource.OnChange := nil, but TDataSource.Enabled must be enabled. I tested following line with a small Delphi program, which exactly does what I expect. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   datasource1.Enabled := not datasource1.Enabled; ---------------------------------------------------------------------- taazz · 2018-08-28 17:55 The help file agrees with you, a quick look on the source also shows that enabled is not used in any of the event processing code, report it on the bug tracker.