AnsweredAssumed Answered

Nothing displays in TreeView window

Question asked by JamesC99 on Oct 28, 2020
Latest reply on Oct 29, 2020 by JamesC99

I'm trying to duplicate Lesson 2's application, but in VB instead of C#.  However, I'm not getting any data from TreeView. 

 

Public afdb As AFDatabase

 

Private Sub AfDatabasePicker1_SelectionChange(sender As Object, e As OSIsoft.AF.UI.SelectionChangeEventArgs) Handles AfDatabasePicker1.SelectionChange

 

  'Clear TreeView.

  AfTreeView1.AFRoot = String.Empty

  afdb = AfDatabasePicker1.AFDatabase

  Debug.WriteLine("AfDatabasePicker: ")

 

  If (afdb IsNot Nothing) Then

    Debug.WriteLine("DB: " & afdb.ToString)

    'Set the root of the TreeView
    If (afdb.Elements IsNot Nothing) Then
        Debug.WriteLine(afdb.Elements.ToString)
        AfTreeView1.AFRoot = afdb.Elements
    End If
  End If

End Sub

 

The debug statements print out:

AfDatabasePicker:
DB: Green Power Company
Elements

Outcomes