Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Datagrid sort date column as string

Reply
Thread Tools

Datagrid sort date column as string

 
 
mkhmer
Guest
Posts: n/a
 
      07-03-2006
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....


 
Reply With Quote
 
 
 
 
Bruno Alexandre
Guest
Posts: n/a
 
      07-03-2006
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" <(E-Mail Removed)> escreveu na mensagem
news:%(E-Mail Removed)...
> 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....
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Toolbox - Table Sort utility - Sort on column's @intattribute Rick Javascript 0 06-08-2010 11:44 PM
datagrid sort Date column as string mkhmer ASP .Net Datagrid Control 0 07-03-2006 03:08 AM
datagrid sort string (is representation of date) as a DATE cindy ASP .Net Datagrid Control 1 03-31-2006 09:29 AM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments