one reference type not updating

aronmatthew

Well-known member
Joined
Aug 5, 2019
Messages
59
Programming Experience
Beginner
Here a sub set from _shelters is added to groupList. Then each reference in groupList is tagged to its own button. In this case when user clicks the button the reference is updated in the next dialog. When the dialog returns the value is not updating in _shelters, only when the value is the first index of groupList. I see no reasonable explanation for this one case only unless the cast from the button Tag could be causing a problem. Unless an exception is being thrown in the next dialog possibly. Will have to double check. But it's updating in the groupList so that's not likely either.

1745371773282.png


using first index of groupList here is a problem while the remaining indexes are updating ok in the same case
current value
1745372225252.png

groupList value
1745372292561.png

_sheltersValue
1745372348954.png
 
Last edited:
Without seeing your code for your _Fshelter form and how to updates the _shelters, it is impossibe to tell.

What is the relationship of _shelters and _shelter? How does a _shelter instance get added into what is presumably a _shelters collection?

Currently, as it stands now, is even hard to tell how _Fshelter knows about groupList.

To make matters worse, your naming convention is unconventional to say the least. The typical naming convention is that a leading underscore prefix means that a variable is a member of the containing class, but as I vaguely recall when I pointed this out years ago, you said that you like using your own naming convention, where in your case the leading unscore is for private class. Does that mean that _shelters is also a class and not a reference to a collection?

Also, please post code as text in code tags, not a screenshots.
 
The base reference simply just failed to update when both sub references did in this one case only what broke the link to the base reference in this one case is still unknown after stepping through all code.
 
_shelters is the base list where from references are added to groupList. In this one case only when a reference is updated it is only updated in groupList. Although this case can be reduced to simple example successfully similar to the remaining cases here. I can't seem to figure why it fails in this case only.
 
Last edited by a moderator:
We don't need a video. We need the simplest code that we can run to see the aberrant behaviour. You may need to create a new test project to cut out all the irrelevant stuff but you should probably have done that already, as part of your own debugging. Creating test projects to isolate problem functionality is a standard part of debugging. Once you have removed all the noise, the actual issue is often quite obvious and you don't even need help from others.
 
I will just post the whole project it's not too big. And a reduced data set with instructions to debug


ok so select the craigslist iterator and place the break point in forms-> Fiterator.cs -> button_click event handler. here a group list of references is created from list _shelters. when the first button is selected "vincent" within the button click will open the edit dialog. here any property can be edited. click ok to return to the break point. here can see that the reference current passed into the edit dialog has been updated along with the reference in group list. however the base reference in _shelters is not being updated only in this "vincent" case which is the first index in group list. this works fine on all the remaining indexes. I will try to create a screen video of the step through.
 
Last edited:
Here a sub set from _shelters is added to groupList. Then each reference in groupList is tagged to its own button. In this case when user clicks the button the reference is updated in the next dialog. When the dialog returns the value is not updating in _shelters, only when the value is the first index of groupList. I see no reasonable explanation for this one case only unless the cast from the button Tag could be causing a problem. Unless an exception is being thrown in the next dialog possibly. Will have to double check. But it's updating in the groupList so that's not likely either.

View attachment 3383

using first index of groupList here is a problem while the remaining indexes are updating ok in the same case
current value
View attachment 3384
groupList value
View attachment 3385
_sheltersValue
View attachment 3386

shit wtf is the problem with this reference not linking. what could possibly be the difference between the vincent case and the other that are linking good. there is no reasonable explanation for the link break in this case. the group list is updated along with the current. why is the base link not updating. is only in vincent case. of first index only could be. need to check the shelters refference on the shelters form after the last reference has been updated although the reference is comming from group list here it updates ok for all but vincent immediately after the update need check the shelter reference. question is what if and what must be the case here that there is no reasonable explanation other than the feng no likes Vincent. have to wait for power to check although is could check now. yea why not check now. and still is crook. no explanation immediately after the reference update the value refuses to update in this case only
 
04-23-25 13-06-00
the only problem seems to be with that one class object "vincent". after simply removing it there is no problem with any remaining similar data. is weird very so weird is demands explanation. call microsoft somebody get crook on the phone because here is the proof. there was no duplicate id for this class object. creating a new instance with same info seems to have solved the problem.
 
Last edited:
Back
Top Bottom