gene
gene

Reputation: 2108

Telerik RadGrid Date column is not formatted to the right format

I have the following column in the Telerik Grid:

<Columns>   
<telerik:GridDateTimeColumn  DataField="Boardingdate" DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}" SortExpression="Boardingdate" UniqueName="Boardingdate"
    HeaderStyle-Width="10%"/>
</Columns>

In my sql logic I get this column' date the following way:

cast(convert(varchar(30),meredsopen,101) as date)

And in the sql it's displayed as follows: 2010-10-04

However, when the Grid renders on the page the date's columns have the values like that:

8/23/2018 12:00:00 AM and I cannot sort it as well.

I can convert the date value to string to show 8/23/2018', but in that case, I think, the sorting will be performed on the string and not on the date` value

How can I fix that?

Upvotes: 0

Views: 294

Answers (0)

Related Questions