Format date in a grid view from yyyymmdd to dd/mm/yyyy

Posted on 2006-04-27
Last Modified: 2008-01-09
I have a dataset where the date is stored as yyyymmdd and would like this displayed as dd/mm/yyyy in the grid view.  Can this be achieve via formatting in the gridview or will I have to cast the data at source (data coming from an AS400 DB2 datable)

Language = C#, IDE = Visual Studio 2005, .NET = 2
Question by:rentonc
    LVL 9

    Accepted Solution

    Hi rentonc,
    best would be if you would cast the data at the source and then in the gridview you would set the format to {0:dd/MM/yyyy}

    LVL 20

    Assisted Solution

    Yeh so in the GridView Bound Field Tag it should have this in also


    for reference the C# Code Behind Method of this is Simply


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, 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…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now