Datagrid sort date column as string

Discussion in 'ASP .Net Datagrid Control' started by mkhmer, Jul 3, 2006.

  1. mkhmer

    mkhmer Guest

    Hi,

    Anyone know how to handle date column sort in grid? it seem to be sorted as
    string now that result below is shown:

    1/1/2006
    1/2/1980
    2/4/1981

    I did formate the column field using "{00:mm/dd/yyyy}" and original field in
    table is also a date type too.

    Appreciate your kindly help on this issue....
    mkhmer, Jul 3, 2006
    #1
    1. Advertising

  2. it doesn't matter the string format, because the grid will sort the data by
    SortExpression

    so all you need to do is add the SortExpression="yourDateField" to your item
    template or boundfield


    --

    Bruno Alexandre
    (a Portuguese in KĂžbenhanv, Danmark)


    "mkhmer" <> escreveu na mensagem
    news:%...
    > Hi,
    >
    > Anyone know how to handle date column sort in grid? it seem to be sorted
    > as string now that result below is shown:
    >
    > 1/1/2006
    > 1/2/1980
    > 2/4/1981
    >
    > I did formate the column field using "{00:mm/dd/yyyy}" and original field
    > in table is also a date type too.
    >
    > Appreciate your kindly help on this issue....
    >
    Bruno Alexandre, Jul 3, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,229
    Michael Borgwardt
    May 30, 2004
  2. cindy

    datagrid sort string (is representation of date) as a DATE

    cindy, Mar 31, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    200
    Steven Cheng[MSFT]
    Mar 31, 2006
  3. mkhmer

    datagrid sort Date column as string

    mkhmer, Jul 3, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    116
    mkhmer
    Jul 3, 2006
  4. Navin
    Replies:
    1
    Views:
    674
    Ken Schaefer
    Sep 9, 2003
  5. Rick
    Replies:
    0
    Views:
    139
Loading...

Share This Page