Hi
I am trying to change the data in a selected node using the following code:
Private Sub OrgChart_NodeMouseRightButtonDown(sender As Object, e As Infragistics.Controls.Maps.OrgChartNodeClickEventArgs) Handles OrgChart.NodeMouseRightButtonDown
Dim employee As Employee = DirectCast(e.Node.Node.Data, Employee)
employee.Name = "Fred Smith"
End Sub
I cannot seem to get the node to show the new data - is there a Refresh method or something else I can use?
Thanks
Andrew
Hi Andrew,
There's nothing wrong with the code you're using so what it looks like you are missing are the INotifyPropertyChanged events on your properties. This will update your node automatically.
Hi Rob
I have added the INotifyPropertyChanged as follows:
Public Class Employee
Implements INotifyPropertyChanged
....
Public Event PropertyChanged(sender As Object, e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
But still nothing changes - unless I click on the Expanded icon for any node when the new Name appears.
Do I need to add code to the OrgChart.PropertyChanged event?