Solved

Grid veiw format a date so it shows the month name

Posted on 2006-06-30
4
364 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
[X]
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
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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