Datagrid-Date Problem
-
In my grid view I want to show only date but it is showing date and time. How can I show Date only
-
A kamath wrote:
I had given like this{dd/mmm/yyyy} but it is showing eror(input string is not in correct format).
give it as {dd/mm/yyyy} then it will not show Error.
Regards, Satips.
-
Paste your code here we will check it out.
Regards, Satips.
-
Paste your code here we will check it out.
Regards, Satips.
-
:sigh:
Regards, Satips.
-
:sigh:
Regards, Satips.
-
In the BoundField event of the DataGrid, Place you code to convert the format. private void dg_BoundField(object, e) { e.Items[3].Value = ((System.DateTime) e.Items[3]).ToString("dd/MM/yyyy", System.Globalization.DateTimeFormatInfo.InvariantI nfo) } Try with this code this will solve your problem. It will display only date.
Regards, Satips.
-
In the BoundField event of the DataGrid, Place you code to convert the format. private void dg_BoundField(object, e) { e.Items[3].Value = ((System.DateTime) e.Items[3]).ToString("dd/MM/yyyy", System.Globalization.DateTimeFormatInfo.InvariantI nfo) } Try with this code this will solve your problem. It will display only date.
Regards, Satips.
-
Welcome.
Regards, Satips.
-
Hi, Better you check for the proper formatstring on the google.
Thanks and Regards, Chetan Ranpariya