Click here to Skip to main content
15,891,850 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
<asp:Label CssClass="block" runat="server" ID="lblSectorFrom" 
Text='<%# DataBinder.Eval(Container.DataItem, "(dep_apt_id)") %>'
ToolTip='<%# DataBinder.Eval(Container.DataItem, "(dep_apt_name)") %>' /
>

   <asp:Repeater ID="repSector" runat="server" DataSource='<%# CType(Container.DataItem,System.Data.DataRowView).Row.GetChildRows("Booking_Part_TO_Sector_FK") %>' >
 <ItemTemplate>
   <asp:Label ID="Label6" CssClass="block" Text='<%# String.Format("{0:dd-MMM-yyyy}", DataBinder.Eval(Container.DataItem, "(dep_datetime)"))%>'
 runat="server" meta:resourcekey="Label6ResourceKey" />
 </ItemTemplate>


Deparure date    from    To 
26june 2015      LHR     LAX
26june 2015      LAX     AKL
03july 2015      LAX     LHR
03july 2015      AKL     LAX

Sorting is happening acc to dep_datetime
It is sorting in incorrect manner because in the database
it is storing values in this format order only but i want to sort it at the time of binding. the correct itineraries should be
LHr-LAX
LAX-AKL

AKL-LAX
LAX-LHR


it will be great help if anyone knows about this.
Posted
Updated 23-Jul-15 22:13pm
v4

I guess the easiest way is to sort the data when fetching it from the database using an ORDER BY clause[^].

Other option is to sort the data already fetched but in order to do that we'd need to know in what kind of structure the data is stored in your program. Is it in data tables, POCO's and so on.
 
Share this answer
 
Comments
Member 11491784 24-Jul-15 3:54am    
its in the form of data tables
Wendelius 24-Jul-15 3:57am    
Then you can use the data view's ability to sort the content of your data table. See DataView.Sort[^]
Simply dataview will work.
see the link:
dataview sort
Hope it helps :)
 
Share this answer
 
Comments
Member 11491784 24-Jul-15 5:16am    
Is there any way to do it on HTML side only?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900