Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2156 - "Dataset not in edit or insert mode" when Append or Insert by code
Summary: "Dataset not in edit or insert mode" when Append or Insert by code
Status: RESOLVED FIXED
Alias: None
Product: TeeGrid for Delphi
Classification: Unclassified
Component: Grid (show other bugs)
Version: unspecified
Hardware: PC Windows
: High major
Target Milestone: ---
Assignee: david berneda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-15 04:59 EST by yeray alonso
Modified: 2020-01-24 10:26 EST (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
test project (2.08 KB, application/x-zip-compressed)
2019-02-15 04:59 EST, yeray alonso
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2019-02-15 04:59:38 EST
Created attachment 886 [details]
test project

See the project attached. This error appears when you Append or Insert (Edit mode works fine):

Project Project5.exe raised exception class EDatabaseError with message 'ClientDataSet1: Dataset not in edit or insert mode'.

If you unlink the TeeGrid and leave only the DBGrid linked to the datasource, both Append and Edit modes work perfectly.
Comment 1 yeray alonso 2019-02-15 05:15:30 EST
Both the Append and the Insert methods set the DataSet Status to dsInsert and they fire the DataSetChange event.
The DataSetChange event in TeeGrid refreshes the DataSet producing this Call Stack:

Data.DB.TDataSet.Cancel
Datasnap.DBClient.TCustomClientDataSet.Cancel
Data.DB.TDataSet.CheckBrowseMode
Data.DB.TDataSet.Last
Tee.GridData.DB.TVirtualDBData.FetchAllRecords
Tee.GridData.DB.TVirtualDBData.InternalRefresh
Tee.GridData.TVirtualData.Refresh
Tee.GridData.DB.TVirtualDataLink.DataSetChanged

The problem is the Cancel function sets the State to dsBrowse and that's what causes the error later.