|
-
Apr 7th, 2005, 04:05 AM
#1
Thread Starter
Member
Displaying Date in DataGrid
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
venkat
Strength is Life, Weakness is Death
- Swami Vivekananda
-
Apr 7th, 2005, 10:31 AM
#2
PowerPoster
Re: Displaying Date in DataGrid
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
-
Apr 7th, 2005, 11:40 PM
#3
Thread Starter
Member
Re: Displaying Date in DataGrid
Thanks John,
Its working fine... Is there any way to display like 09-Apr-2005...
venkat
venkat
Strength is Life, Weakness is Death
- Swami Vivekananda
-
Apr 8th, 2005, 12:46 AM
#4
PowerPoster
Re: Displaying Date in DataGrid
Change the format string to:
{0:dd-MMM-yy}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|