I am using TcxGridDBBandedTableView and have two columns of type TcxGridDBBandedColumn.
vwABC : TcxGridDBBandedTableView
vwABCField1 : TcxGridDBBandedColumn
vwABCField2 : TcxGridDBBandedColumn
When I change anything in vwABCField1, vwABCField2 values should get cleared. For this I am using OnEditValueChanged property of vwABCField1 like this:
procedure TMyForm.vwABCField1PropertiesEditValueChanged(Sender: TObject);
begin
vwABCField2.EditValue := '';
end;
While debugging, when I come to vwABCField2.EditValue := ''; statement, I never return back and get trapped in infine loop and after some time I get stackoverflow error.
vwABCField2.EditValue := ''; is calling vwABCField1PropertiesEditValueChanged procedure again and again recursively infinite time. I don't know why. I have not declared anything on OnEditValueChanged event of vwABCField2.
Update
If I write anything else in the above function instead of vwABCField2.EditValue := '';, it will be called only once. For example
procedure TMyForm.vwABCField1PropertiesEditValueChanged(Sender:TObject);
begin
ShowMessage("hi");
end;
works fine. So I suspect that culprit is vwABCField2.EditValue := ''; statement.
-
@StefanGlienke - Yes I checked. vwABCField1PropertiesEditValueChanged method is getting called again and again.user1556433– user15564332014年02月18日 09:23:33 +00:00Commented Feb 18, 2014 at 9:23
-
You should see where it comes from the 2nd time as you said that should not happenStefan Glienke– Stefan Glienke2014年02月18日 09:24:22 +00:00Commented Feb 18, 2014 at 9:24
-
2Stackoverflow error shockedDeepak Ingole– Deepak Ingole2014年02月18日 09:24:53 +00:00Commented Feb 18, 2014 at 9:24
-
1Maybe the change to vwABCField2 forces some kind of update to the database and then all fields all traversed and another Change() is triggered. Look at the call stack, trace the DevEx code, make a reproducable case to post in the DevEx forums.Jan Doggen– Jan Doggen2014年02月18日 10:44:36 +00:00Commented Feb 18, 2014 at 10:44
-
1And have you searched the DevEx forums for 'stack overflow'? Could this be related: devexpress.com/Support/Center/Question/Details/Q523958Jan Doggen– Jan Doggen2014年02月18日 10:46:55 +00:00Commented Feb 18, 2014 at 10:46
1 Answer 1
As in the official documentation is stated:
Do not change the edit value in your OnEditValueChanged event handler, as this can result in stack overflow. Use this event to get notification that the edit value has changed.
Because when you change the edit value in this event, of course, your editvalue is changed and therefore calling the OnEditValueChanged event again and again and ...