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
-
Check for
DataFormatString
property in your Columns.Mazy
"This chancy chancy chancy world." -
Thank you can you tell me how should I give inside the property column. I had given like this{dd/mmm/yyyy} but it is showing eror(input string is not in correct format).
hi, you can use split function, then it will solve. thanks
-
Thank you can you tell me how should I give inside the property column. I had given like this{dd/mmm/yyyy} but it is showing eror(input string is not in correct format).
U can do this in query it self, use this: SELECT Convert(nvarchar(11), Ur Date , 13) AS DateOnly From Table. Hope this helps u....
-
Thank you can you tell me how should I give inside the property column. I had given like this{dd/mmm/yyyy} but it is showing eror(input string is not in correct format).
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.
-
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