Sorting

jeo

Registered User.
Local time
Today, 00:09
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!
 
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?
 
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.
 
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

Back
Top Bottom