?
Solved

Grid veiw format a date so it shows the month name

Posted on 2006-06-30
4
Medium Priority
?
370 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 375 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

840 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