Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Grid veiw format a date so it shows the month name

Posted on 2006-06-30
4
363 Views
Last Modified: 2008-03-17

Hi all,
I have a grid view which displays a date from a database. I have the date in the dd-mm-yyyy format by putting this code in the source of the aspx page:
DataFormatString="{0:dd-M-yyyy}" HtmlEncode="False"

Is there a format i can use to get the following:
2 March 2006

instead of 2/3/2006?

Cant find the right info on this as there so much on it!
Cheers
D
0
Comment
Question by:CoreSupport
  • 3
4 Comments
 
LVL 19

Accepted Solution

by:
DreamMaster earned 125 total points
ID: 17016454
How about changing the field to a Templatefield...like so:

<asp :TemplateField HeaderText=“CreationDate” >
   <edititemtemplate>
    <asp :Label ID=“Label1&#8243; runat=“server”
      Text=‘<%# Eval("CreationDate", "{0:dd-M-yyyy}") %>‘>
    </asp>
   </edititemtemplate>
   <itemtemplate>
    <asp :Label ID="Label1" runat="server"
      Text=’<%# Bind(“CreationDate”, “{0:dd-M-yyyy}”) %>‘>
    </asp>
   </itemtemplate>
  </asp>

Hope that helps,

Regards,
Max.
0
 

Author Comment

by:CoreSupport
ID: 17016551
Hey
havent done that before...
Can I call a method in the asp then and just work out what the month is based on the month id?
Cheer
d
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 17016723
You could do that..

Regards,
Max.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 17016858
Glad to have been helpfull.

Regards,
Max.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question