This is a migrated thread and some comments may be shown as answers.

RadGrid Date/Time column format problem

1 Answer 349 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kostas
Top achievements
Rank 1
kostas asked on 25 Apr 2011, 01:52 PM
Hello
I'm having problem display correct date or time values in the Grid
The date column looks like 9/4/2011 12:00:00 πμ and the time column looks like 30/12/1899 2:18:39 μμ
I try everything i found in the forum like

Protected

 

Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged

 

 

 

Dim colDates As GridBoundColumn

 

 

colDates = RadGrid1.Columns.FindByDataField(

"MyDate")

 

 

colDates.DataFormatString =

"{0:dd/MM/yyyy}"

 

 

Dim colTimes As GridBoundColumn

 

 

colTimes = RadGrid1.Columns.FindByDataField(

"MyTime")

 

 

colTimes.DataFormatString =

"{0:t}"

 

 

Me.RadGrid1.Rebind()

 

 

 

End Sub

but still i got the same format.
Any ideas?

 

1 Answer, 1 is accepted

Sort by
0
Accepted
O'Man
Top achievements
Rank 1
answered on 28 Apr 2011, 08:25 AM
Hi,

Chek Customizing columns proggrammatically here:

http://www.telerik.com/help/aspnet-ajax/grid-using-columns.html

Tanks,
Oman
Tags
Grid
Asked by
kostas
Top achievements
Rank 1
Answers by
O'Man
Top achievements
Rank 1
Share this question
or