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

DateFormatString not work for Date

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amitkumar
Top achievements
Rank 1
Amitkumar asked on 24 Dec 2009, 10:02 AM
Hi All,

Not display in date format, what's wrong with follwoing code:

<telerik:GridBoundColumn AllowFiltering="false" DataField="LoggedInFor"
                                            Display="true" HeaderStyle-Width="7%" HeaderText="Last Login"
                                            UniqueName="LoggedIn" DataFormatString="{0:D}">
                                            <HeaderStyle Width="7%" />
                                        </telerik:GridBoundColumn>


or

DataFormatString="{0:MMM/dd/yyyy}"


Thanks & Regards
Amit



1 Answer, 1 is accepted

Sort by
0
Amitkumar
Top achievements
Rank 1
answered on 24 Dec 2009, 10:25 AM
I found my Solution

I modified your code-snippet:
<telerik:GridBoundColumn DataField="MyDate" DataType="System.DateTime" HeaderText="Date"
  UniqueName="MyDate" DataFormatString="{0:M/d/yyyy}" HtmlEncode="false"/>

Note that the data type (in the DB) should be DateTime.



Tags
Grid
Asked by
Amitkumar
Top achievements
Rank 1
Answers by
Amitkumar
Top achievements
Rank 1
Share this question
or