This code gets the file name and date and populates two columns in a datagridview. but when I click the column heading to sort in date order it sorts like text since it is text. How to I convert the date into something the grid will sort like a real date? Or can I? its in red below
FileDate = fi.CreationTime.ToString
also need to conver it so the
DougP
FileDate = fi.CreationTime.ToString
also need to conver it so the
Code:
Dim Path As String
Path = "\\Foc01\SharedDir\Church\Announcements\old pdf announcements"
Dim strFileSize As String = ""
Dim di As New IO.DirectoryInfo(Path)
Dim aryFi As IO.FileInfo() = di.GetFiles("*.pdf")
Dim fi As IO.FileInfo
Dim i As Integer
Dim arrayFileList(300)
Dim arrayFileCreatedDate(300)
i = 0
For Each fi In aryFi
[COLOR=red][b]FileDate = fi.CreationTime.To a Date???[/b][/color]
DataGridView1.Rows.Add(fi.Name, FileDate)
Next
DougP