masterdeveloper Posted April 18, 2018 Share Posted April 18, 2018 Good afternoon everyone I'm using a grid problem, where when I select a record, it returns the following error message: "Grid is in dirty state. No more updates can be applied." The grid is simple, and has no special behavior. The error happens the moment the checkbox is clicked to select the record in the grid. Link to comment Share on other sites More sharing options...
Sherzod Posted April 19, 2018 Share Posted April 19, 2018 Hello, Which build are you using? Link to comment Share on other sites More sharing options...
masterdeveloper Posted April 19, 2018 Author Share Posted April 19, 2018 Hello Delphi Developer, i using biuld: uni-1.0.0.1410 Link to comment Share on other sites More sharing options...
Sherzod Posted April 19, 2018 Share Posted April 19, 2018 Hello, Can you please try with latest beta build too? Or can you make a simple testcase for this issue if possible? Link to comment Share on other sites More sharing options...
masterdeveloper Posted April 19, 2018 Author Share Posted April 19, 2018 Okay, I'll update later to see if it solves the problem. Thanks in advance for the Delphi Developer attention. Link to comment Share on other sites More sharing options...
masterdeveloper Posted September 3, 2018 Author Share Posted September 3, 2018 Good afternoon, we updated to the latest version uni-1.50.0.1479 and the problem persists. I believe the problem is in the procedure: procedure TUniCustomDBGrid.H_OnDataLoaded (This: TJSObject; EventName: string; Params: TUniStrings); var DoRst: Boolean; dts: TDataSet; begin ClearGridDirtyState (True); FLoadDataStarted: = False; FGridDirty: = False; <<< ------------- ... This event is not called on my grid a few times. Apparently it is falling into this procedure "TUniCustomDBGrid.SetCellValue" before falling into this procedure "TUniCustomDBGrid.H_OnDataLoaded". That way the FGridDirty variable is not updated in time. In the event: procedure TUniCustomDBGrid.LoadDataX is set to the variable value: procedure TUniCustomDBGrid.LoadDataX; begin if FGridLoadRec.Dirty then begin FGridLoadRec.Dirty := False; FGridDirty := True; ... but this variable does not get "False" BEFORE entering the procedure "TUniCustomDBGrid.SetCellValue", this procedure is called AFTER passing the procedure "TUniCustomDBGrid.SetCellValue". Summarizing the problem that happens on my grid: 1- When selecting a record in the grid, the procedure TUniCustomDBGrid.LoadDataX; is called 2- This procedure points to the value of the variable FGridDirty: = True; 3- The procedure TUniCustomDBGrid.H_OnDataLoaded should now be called, but it is not 4- The value of the FGridDirty variable is false 5- The procedure procedure TUniCustomDBGrid.SetCellValue is called 6- Validation happens and aborts processing: if FGridDirty then raise Exception.Create ('Grid is in dirty state. No more updates can be applied.'); 7- After the error appears, the procedure "TUniCustomDBGrid.H_OnDataLoaded" is called, it seems to me that it has a delay. Note: The field I select on the grid is of type "CheckboxField". I believe that: When the field is of type "Checkboxfield", when opening the grid and marking this field first (without selecting the line), the procedure "TUniCustomDBGrid.H_OnDataLoaded" is not called. If you select the line, then mark the checkbox, the procedure is called correctly. I could not simulate this situation in a test case, it only occurs in my application. Any tips? Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now