Posted 27 September 2017, 8:49 pm EST
Hi,
I’m not sure if this an issue with VB.net or with the flexgrid control, but it does not happen when I use other objects.
If I assign a flexgrid node object to another variable, I would expect them to point to the same node object. But this is not the case.
Example:
[vb]
Dim tn As Node = grdTree.Nodes(4).Nodes(2) ’ where grdTree is a C1FlexGrid object I created Nodes in
Dim TheyAreEqual As Boolean
TheyAreEqual = (tn Is grdTree.Nodes(4).Nodes(2))
Debug.Writeline(TheyAreEqual) ’ Outputs ‘False’
[/vb]
If I compare the results of grdTree.Nodes(3).GetHashCode and tn.GetHashCode, they are different.
The same thing occurs if I compare in this way:
[vb]
Debug.Writeline(grdTree.Rows(10).Node Is grdTree.Nodes(4).Nodes(2)) ’ ← These are the same Node
[/vb]
This comparison also returns False.
The kicker is that if I modify, say, the Data property of tn
[vb]
tn.Data = “New Data”
[/vb]
all three references will change to the new value! So they all seem to be the same object, yet I cannot compare them directly, and their hash values are different.
As I mentioned above, I have tried this with other objects, and this does not happen. For now, I have resorted to comparing the Data property to check if the objects are the same.
Any ideas?
Debug.Writeline(