Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 20th, 2005, 12:06 AM
Authorized User
 
Join Date: Mar 2005
Location: Bangalore, Karnataka, India.
Posts: 36
Thanks: 2
Thanked 1 Time in 1 Post
Default Formatting the date field in Data Grid

Hello,
I am reading data from Excel sheet (select * from workshee)and binding the data set to grid. I hava a date field in the excel sheet and while showing the date in grid it is coming as date time format. I want the grid to show only the date not time. How can I format the grid to show the date only? I cannot change the select statement. So I need a solution which can change the formatting in the grid.
  #2 (permalink)  
Old April 20th, 2005, 01:00 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Hi Check out this article..This is regarding formatting datatime in datagrid..
http://www.c-sharpcorner.com/Code/20...taGridData.asp


  #3 (permalink)  
Old April 21st, 2005, 04:01 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

you can format the data in the grid by using a DataFormatString

Code:
<asp:BoundColumn DataField="TxnDate" HeaderText="Date" DataFormatString="{0:dd-MMM-yyyy hh:mm}"></asp:BoundColumn>
Regards
Ganesh
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Field Validation in an Editable Data Grid Shadane ASP.NET 1.0 and 1.1 Basics 3 October 2nd, 2006 09:02 AM
formatting integer field gloribel Crystal Reports 1 October 13th, 2005 12:27 PM
Formatting Querystring Field Name realgone_ VBScript 4 September 23rd, 2004 07:52 AM



All times are GMT -4. The time now is 05:30 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.