picyka Posted May 3 Share Posted May 3 I would like to ask for help, is there any way to improve my code so that these errors no longer occur? Message: TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 0, 4 Message: Grid is in dirty state. No more updates can be applied. @Farshad Mohajeri Thank you for any tip. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 3 Administrators Share Posted May 3 52 minutes ago, picyka said: I would like to ask for help, is there any way to improve my code so that these errors no longer occur? Message: TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 0, 4 Message: Grid is in dirty state. No more updates can be applied. @Farshad Mohajeri Thank you for any tip. Hi, We have done several modifications in recent versions so these errors must be very rare. If you can send us a test case which can reproduce these bugs we will happy to look into it. Quote Link to comment Share on other sites More sharing options...
picyka Posted May 3 Author Share Posted May 3 Well, the first message I can simulate on my system, the second I never managed to do, I already received a print from the user, but these are very random cases. 1) Basically there I have a grid that can be searched by columns, in the last column, I have a UniCheckComboBox, where the user can select one or more values. Error image attached, I can even try to do a test case later. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted May 3 Share Posted May 3 I have this problem every day and I can't solve it, it only happens in production. Quote Link to comment Share on other sites More sharing options...
picyka Posted May 3 Author Share Posted May 3 This was another test case here on the forum, I just used it to advance the example. My additional code was just the UniCheckComboBox1 and the filter event on the grid. Error.zip is a video, you need to select the SC filter and click on the column, this is all very quick. Error.zip Grid - DbGrid Editavel.zip Quote Link to comment Share on other sites More sharing options...
picyka Posted May 3 Author Share Posted May 3 Master @Farshad Mohajeri, I hope I can help you. Quote Link to comment Share on other sites More sharing options...
picyka Posted May 3 Author Share Posted May 3 unit uniDBGrid; function SetCurrentRowCol(ARow, ACol:Integer; SuppParams: array of string):Boolean; override; It seems that it tries to select the line and is processing the filter, which ends up causing the error, I don't know if I'm quite sure about this theory. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 4 Administrators Share Posted May 4 Hi, Is this the latest uniGUI build ? Quote Link to comment Share on other sites More sharing options...
picyka Posted May 4 Author Share Posted May 4 5 minutes ago, Farshad Mohajeri said: Hi, Is this the latest uniGUI build ? In production I use version 73, this test is version 55. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 4 Administrators Share Posted May 4 Just now, picyka said: In production I use version 73, this test is version 55. Build number? Does your build include below fix? [UNG-3473] - TUniDBGrid: Workaround for RecNo mismatch error. Quote Link to comment Share on other sites More sharing options...
picyka Posted May 4 Author Share Posted May 4 Test = 1555 production = 1573 Quote Link to comment Share on other sites More sharing options...
picyka Posted May 4 Author Share Posted May 4 Component: UniDBGridServicos (TUniDBGrid) Parent: UniFrameCadFornecedor0 LastAjaxEvent: actionclick Class: Exception Message: TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 2, 3 Version: 1573 Quote Link to comment Share on other sites More sharing options...
picyka Posted May 4 Author Share Posted May 4 Last Builder Quote Link to comment Share on other sites More sharing options...
picyka Posted May 4 Author Share Posted May 4 I'll help you simulate the error very easily. procedure TMainForm.UniDBGrid1ColumnFilter(Sender: TUniDBGrid; const Column: TUniDBGridColumn; const Value: Variant); begin if Column.FieldName = 'LOG_UF' then begin CDCadastro.Filtered := False; if Value <> '' then begin var lFiltro := ''; if VarToStr(Value).Contains(';') then lFiltro := 'SC' else lFiltro := VarToStr(Value); Sleep(1000); CDCadastro.Filter := 'LOG_UF=' + QuotedStr(lFiltro); CDCadastro.Filtered := True; end; end; end; Sleep(1000); In my production system, the error occurs more easily than in the demo, because there is a small delay in loading the data. so I put a Sleep(1000); After selecting the SC value, click very quickly on more than one line. @Farshad Mohajeri Quote Link to comment Share on other sites More sharing options...
picyka Posted May 4 Author Share Posted May 4 Perhaps the grid mask would have to be activated in the OnColumnFilter event, and not just when loading the data. Quote Link to comment Share on other sites More sharing options...
andyhill Posted May 4 Share Posted May 4 I never use SLEEP, instead use ajaxrequest with delay. ... UniSession.AddJS('Ext.defer(function() {ajaxRequest(MainForm.window, ''_SetFilter_'', [])}, 300);'); ... procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if SameText('_SetFilter_', EventName) then begin ... Quote Link to comment Share on other sites More sharing options...
picyka Posted May 4 Author Share Posted May 4 19 minutos atrás, andyhill disse: Eu nunca uso SLEEP, em vez disso uso ajaxrequest com atraso. ... UniSession.AddJS('Ext.defer(function() {ajaxRequest(MainForm.window, ''_SetFilter_'', [])}, 300);'); ... procedimento TMainForm.UniFormAjaxEvent(Remetente: TComponent; EventName: cadeia de caracteres; Params: TUniStrings); começar se SameText('_SetFilter_', EventName) então comece ... I believe that no one should use SLEEP there anyway, it was just a way to simulate a delay when loading the data. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted May 6 Share Posted May 6 I have this problem every day, but it only happens in production and it's difficult to know when it is, I know in which times but I don't know in which event it happens. Quote Link to comment Share on other sites More sharing options...
picyka Posted May 6 Author Share Posted May 6 From the tests I did, I understood that errors can happen at times. ActionClick for example, if the user clicks on an action, and there is no mask there, for some reason there may be a delay in processing, if the user changes the grid lines the error will also occur. There in the example, I put a Sleep(1000) just to simulate a delay in loading the data. I don't know how to solve this, but I believe that the filter event mask should be activated when the filter is selected, blocking the grid so the user cannot do anything. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 6 Administrators Share Posted May 6 Hi, @Hayri ASLAN was able to reproduce the issue using the above test case. It means that we can implement a solution / work around soon. Thanks 1 Quote Link to comment Share on other sites More sharing options...
picyka Posted May 6 Author Share Posted May 6 Very good news, thank you. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted May 6 Share Posted May 6 thank you. 🤲 Quote Link to comment Share on other sites More sharing options...
picyka Posted May 14 Author Share Posted May 14 Any news? 1 Quote Link to comment Share on other sites More sharing options...
picyka Posted Tuesday at 04:50 PM Author Share Posted Tuesday at 04:50 PM Any news? 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.