I'm using VB 2005 and I have a DataGridView that I am populating manually.
e.g.
Expand|Select|Wrap|Line Numbers
- Private Sub List_Dates()
- dgvDates.Rows.Clear()
- Dim c As Integer
- Dim Row() As String = New String(3) {}
- For c = 0 To WorkstationCount
- Row(0) = Workstations(c)
- Row(1) = FormatDateTime(DatesAssign(c), DateFormat.ShortDate)
- Row(2) = FormatDateTime(DatesAgent(c), DateFormat.ShortDate)
- dgvDates.Rows.Add(Row)
- Next
- End Sub
Anyway, everything works fine except that when I click on the column header to sort the two dates columns, they sort as a string, not as a date.
I've seen various very similar questions, but none of them answer the question for me (I suppose primarily because I am not binding a data source).
What can I do to get these columns to sort as a date?
Thanks,
Steve