I have a column that is a datetime but I only want to show time. I tried dataformatstring="{0:H:mm:ss}" but that didn't work. So, I went into my code behind and took the column and formatted it myself.
Dim nt = ""
If (reader("NextContactTime").ToString <> "") Then
Dim tempTime As New DateTime
tempTime = reader("NextContactTime")
nt = tempTime.ToShortTimeString
End If
I then add nt to the data table that I bind my grid with. The problem is, when I use the built in sort function, it doesn't sort properly. I have the column type defined as datetime in my data table and I also made sure all of the days are the same. I.e. only the time is different they all are 01/01/2012 9:30:00 01/01/2012 9:45:00
What is the best way to show just time in a column and allow it to be sorted?
Dim nt = ""
If (reader("NextContactTime").ToString <> "") Then
Dim tempTime As New DateTime
tempTime = reader("NextContactTime")
nt = tempTime.ToShortTimeString
End If
I then add nt to the data table that I bind my grid with. The problem is, when I use the built in sort function, it doesn't sort properly. I have the column type defined as datetime in my data table and I also made sure all of the days are the same. I.e. only the time is different they all are 01/01/2012 9:30:00 01/01/2012 9:45:00
What is the best way to show just time in a column and allow it to be sorted?