如何选择节点到列表类型自定义类

时间:2016-06-09 14:00:16

标签: asp.net .net vb.net web telerik

我有这堂课:

Protected Class MyClass

    Public item1 As Integer = 0
    Public item2 As Boolean = False

End Class

然后我创建一个将填充TreeView(Telerik)节点的MyClass列表

 Dim customlist As New List(Of MyClass)

 For Each node As RadTreeNode In rtv.GetAllNodes
        Dim item As New MyClass
        item.item1 = node.Value
        item.item2= node.Checked
        customlist.Add(item)
    Next

但是我不想用foreach填充列表¿我如何处理linq?例如:

Dim customlist As List(Of MyClass) = rtv.GetAllNodes.Select(Of MyClass)(¿what code goes here?).ToList()

感谢。

0 个答案:

没有答案