I had something like this in mind (untested, typed directly in this forum thread and only just used to show the general idea):
Code:
[FileSummary.vb]
Public Class FileSummary
Public Sub New(ByVal fileName As String)
_fileName = fileName
End Sub
Private _fileName As String
Public Property FileName() As String
Get
Return _fileName
End Get
Set(ByVal Value As String)
_fileName = Value
End Set
End Property
End Class
Then in our ASPX file:
Code:
Dim fileSummaries As New List(Of FileSummary)
For Each specificFile In fileArray
If specificFile.Extension = ".txt" Or specificFile.Extension = ".doc" Then
If specificFile.Name.StartsWith("1") Then
fileSummaries.Add(New FileSummary("CSTLRK"))
Else
fileSummaries.Add(New FileSummary(specificFile.Name))
End If
End If
Next specificFile
dgArticleList.DataSource = fileSummaries
dgArticleList.DataBind()
This way, you create a generics list of FileSummary instances that do nothing more than contain the filename. The constructor that accepts the file name is used to make it easier to construct new instances of FileSummary.
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
Beginning ASP.NET 3.5 : in C# and VB,
ASP.NET 2.0 Instant Results and
Dreamweaver MX 2004
Want to be my colleague? Then check out this post.