Hi, I'm having an issue refreshing the data in my treeview. Here is the treeview.
Now, when I modify the underlying data the treeview doesn't change. It does change if I add data to the underlying tables. If I add a new Company.Department.Employee to the datatables the treeview updates, with an expandall(). However if I change department A to now be in department C instead of B it doesn't move until I reload the app. Any idea's anyone? How can I get the treeview to show changes made to the datasource.
Thanks
'Build Tree View
Private
Sub
BuildtvOrgan()
tvOrgan.RelationBindings.Add(
New
RelationBinding(
"CompanyDepts"
,
Me
.DepartmentBindingSource))
tvOrgan.RelationBindings.Add(
New
RelationBinding(
"Department_Employee"
,
Me
.EmployeeBindingSource))
tvOrgan.RelationBindings.Item(0).DisplayMember =
"DeptName"
tvOrgan.RelationBindings.Item(0).ValueMember =
"id"
tvOrgan.RelationBindings.Item(0).DataSource = DepartmentBindingSource
tvOrgan.RelationBindings.Item(1).DisplayMember =
"FName"
tvOrgan.RelationBindings.Item(1).ValueMember =
"id"
tvOrgan.RelationBindings.Item(1).DataSource = EmployeeBindingSource
tvOrgan.DataSource = CompanyBindingSource
tvOrgan.ValueMember =
"id"
SetImages(tvOrgan.Nodes)
tvOrgan.ExpandAll()
End
Sub
Now, when I modify the underlying data the treeview doesn't change. It does change if I add data to the underlying tables. If I add a new Company.Department.Employee to the datatables the treeview updates, with an expandall(). However if I change department A to now be in department C instead of B it doesn't move until I reload the app. Any idea's anyone? How can I get the treeview to show changes made to the datasource.
Thanks