EhLib.Com
https://forum.ehlib.com/en/

DBGridEh Sortlocal with TClientDataSet error
https://forum.ehlib.com/en/viewtopic.php?f=5&t=983
Page 1 of 1

Author:  danieldavila [ 04 Jul 2019, 14:51 ]
Post subject:  DBGridEh Sortlocal with TClientDataSet error

Hello,

I'm using TDBGridEh and DataSource linked with TClientDataSet.
The SortLocal on DBGridEh is set to True and I declared the unit EhLibCDS.pas
If the ClientDataSet is not active when i try sort some column clicking on grid title, delphi's returns closed ClientDataSet error.

i've fixed with this on EhLibCDS.Pas:
Code:
procedure TCDSDatasetFeaturesEh.ApplySorting(Sender: TObject; DataSet: TDataSet; IsReopen: Boolean);
var
  DS: TDataSet;
  CDS: TCustomClientDataSetCrack;
  DatasetFeatures: TDatasetFeaturesEh;
  i: Integer;
  IndexFields, IndexDescFields, MasterFields: String;
  SortOrder: TSortOrderEh;
  grid: TCustomDBGridEh;
begin
  if Sender is TCustomDBGridEh then
    if (TCustomDBGridEh(Sender).SortLocal) then
    begin
      if (not DataSet.Active) then
        Exit;
      if DataSet.RecordCount = 0 then
        Exit;
    .....

it is the right fix to this problem?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/