I need a List(of string) to supply as the property to a custom control (an specialized type of autocompletetextbox). I have a CSLA.NameValueListBase(Of integer, String) that contains the values I want. How do I use LINQ or whatever code to convert the CSLA object to the Generic List?
thanks
I think it is this:
Module Module1
Sub Main()
Dim obj = TestNvl.GetList
Dim list = (From r In obj Select r.Value).ToList
For Each item In list
Console.WriteLine(item)
Next
Console.ReadLine()
End Sub
End Module
<Serializable()>
Public Class TestNvl
Inherits Csla.NameValueListBase(Of Integer, String)
Public Shared Function GetList() As TestNvl
Dim result = New TestNvl
result.IsReadOnly = False
result.Add(New TestNvl.NameValuePair(1, "dasf"))
result.Add(New TestNvl.NameValuePair(2, "werew"))
result.Add(New TestNvl.NameValuePair(3, "dfgdf"))
result.Add(New TestNvl.NameValuePair(4, "zvzew"))
result.IsReadOnly = True
Return result
End Function
End Class
Copyright (c) Marimer LLC