I am looking for some help as I am new to this control.
I have set up a RadTreeView to pull data from an Oracle database via the Datasources option. I have been able to load 3 levels of data. Now, I want to be able to edit the data on the treeview and that update be replicated back to the oracle database.
Thus far I have come up with the following. However I think I am missing something.
When I update a Node, the data is saved back to the database but the child nodes on the treeview dissapear (since the parent has now changed). I cannot find a way of refreshing the treeeview. Can somebody please help??
Private Sub RadTreeView1_Edited(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.TreeNodeEditedEventArgs) Handles RadTreeView1.Edited
On Error GoTo ErrMsg
Dim DBConnection As New OleDbConnection("Provider=msdaora;Data Source=ubrmos01;User Id=tiadmin;Password=******")
Dim strsql As String
If e.Node.Level = 0 Then
DBConnection.Open()
strsql =
"UPDATE APPLICATION set APPLICATION = " & "'" & e.Node.Text & "'" & " where APPLICATION = " & "'" & Text_beforeedit & "'"
Dim Command As New OleDbCommand(strsql, DBConnection)
Command.ExecuteNonQuery()
End If
If e.Node.Level = 1 Then
DBConnection.Open()
strsql =
"UPDATE ENVIRONMENT set ENVIRONMENT = " & "'" & e.Node.Text & "'" & " where ENVIRONMENT = " & "'" & Text_beforeedit & "'"
Dim Command As New OleDbCommand(strsql, DBConnection)
Command.ExecuteNonQuery()
End If
Exit Sub
errmsg:
e.Node.Text = Text_beforeedit
MsgBox(Err.Description, MsgBoxStyle.Critical,
"Error Updating Database")
End Sub