DataBind Listview to Text File in

I know it is a strange request. My argument was wouldn’t it be easier to just read the thing myself? Well that wasn’t what was asked and I suppose they had had their reasons. The text view looked like this:


Using the above data, after the GUI window opens, the contents of the listview will be taken from the 4th caret-delimited piece, and the contents of the listview will be:

So here is what I came up with:

Dim source As New List(Of SourceItem)
For Each line As String In File.ReadAllLines(filename)
   If line.Length > 0 Then
      source.Add(New SourceItem(line.Split("^"C)(3)))
   End If
Public Class SourceItem
   Private string _data
   Public ReadOnly Property Data
         Return _data
      End Get
   End Property
   Public Sub New(data As String)
      _data = data
   End Sub
End Class
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: