Sorting (1 Viewer)

jeo

Registered User.
Local time
Today, 06:30
Joined
Dec 26, 2002
Messages
299
I can't figure out how to sort a field in Ascending order.
this is what i have:
<asp:TemplateField>
<HeaderTemplate>
<b><u>Live Date</u></b>
</HeaderTemplate>
<ItemTemplate>
<%#formatdatetime(Eval("TaskStartDt"), DateFormat.ShortDate)%>
</ItemTemplate>
</asp:TemplateField>I want to sort TaskStartDt in Ascedning onrder when it's displayed on the page.
Any ideas on how I can do that?
Thank you!
 

dan-cat

Registered User.
Local time
Today, 06:30
Joined
Jun 2, 2002
Messages
3,433
I would recommend you do this from the datasource of your datagrid. ie sort your data as required before binding to the datagrid control.

Can you show us the script that binds your data to your datagrid?
 

jeo

Registered User.
Local time
Today, 06:30
Joined
Dec 26, 2002
Messages
299
you pointed me in the right direction, so i put it in my sSQL condition statement and used ORDER BY before doing the databind statement.
thank you! really appreciate your suggestion.
 

dan-cat

Registered User.
Local time
Today, 06:30
Joined
Jun 2, 2002
Messages
3,433
jeo said:
you pointed me in the right direction, so i put it in my sSQL condition statement and used ORDER BY before doing the databind statement.
thank you! really appreciate your suggestion.

Sorted! :D
 

Users who are viewing this thread

Top Bottom