PDA

Click to See Complete Forum and Search --> : Displaying Date in DataGrid


nvenkat75
Apr 7th, 2005, 04:05 AM
Hi All,

i'm displaying a date field along with other fields in datagrid. while i tried, i'm able to get all the values from the table, also the date field. but it is displaying along with the time

Ex : for "2/25/2005" i'm getting "2/25/2005 12:00:00 AM"

i use dataadapter to fill the datagrid.

can any one help me

thanx

venkat

veryjonny
Apr 7th, 2005, 10:31 AM
hi,

In the design mode go to the Datagrid - Property builder, go to the columns section and select the Data Field which you have, there on the lower side you can see the "data Formating expression" box.

Enter the Format you want the Datagrid to display

For example:

{0:d} will display Date in Short date format

nvenkat75
Apr 7th, 2005, 11:40 PM
Thanks John,

Its working fine... Is there any way to display like 09-Apr-2005...

venkat

veryjonny
Apr 8th, 2005, 12:46 AM
Change the format string to:

{0:dd-MMM-yy}