我試圖添加對象到devexpress的treelist。但遺憾的是,它不會自動填充單元格,而是在每個單元格中顯示對象名稱。Devexpress Treelist添加對象只顯示對象名稱
Public Class TempItem
Private m_name As String
Private m_value As String
Public Property Name() As String
Get
Return m_name
End Get
Set(value As String)
m_name = value
End Set
End Property
Public Property Value() As String
Get
Return m_value
End Get
Set(value As String)
m_value = value
End Set
End Property
末級
Private Function TempItem1() As List(Of TempItem)
Dim tmpList As New List(Of TempItem)
tmpList.Add(New TempItem("Feature", "0"))
tmpList.Add(New TempItem("Feature2", "1"))
Return tmpList
End Function
而且我通過這條線添加對象:
tlEditor.Nodes.Add(TempItem1.ToArray)
我在樹形列表兩列。對於第一列,我已將字段名稱設置爲名稱,第二列中的字段名稱設置爲值期望排列列表顯示TempItem類中屬性的值。在這種情況下,樹列表應該顯示:
特徵| 0 特徵2 | 1
但相反,它在每個單元格中顯示WindowsApplication1.TempItem。像
WindowsApplication1.TempItem | WindowsApplication1.TempItem WindowsApplication1.TempItem | WindowsApplication1.TempItem
我做了什麼錯?