In order for explanation purposes... let's say I have a table that is generated by a table in my database..
This table holds 3 pieces of information, FlightDate
, Aircraft
, Pre / Post
.
So, the logic behind this is that there should be a pre-flight and a post-flight per day.
Now, for clarity, let's say the table so far looks like this:
|Date| | |Aircraft| | |Pre / Post|
04/08/2016 | aircraft1 | Pre-Flight
04/08/2016 | aircraft3 | Pre-Flight
04/08/2016 | aircraft2 | Pre-Flight
04/08/2016 | aircraft3 | Post-Flight
04/08/2016 | aircraft1 | Post-Flight
04/08/2016 | aircraft2 | Post-Flight
As you can see there is no order by that table (except for maybe the date, but I just made this up).
Now what I would like to happen is when the page loads to display this table, for the table to be ordered by the Aircraft
and it's Pre / Post
based on the Date
...
so essentially what I am looking for:
|Date| | |Aircraft| | |Pre / Post|
04/08/2016 | aircraft1 | Pre-Flight
04/08/2016 | aircraft1 | Post-Flight
04/08/2016 | aircraft2 | Pre-Flight
04/08/2016 | aircraft2 | Post-Flight
04/08/2016 | aircraft3 | Pre-Flight
04/08/2016 | aircraft3 | Post-Flight
04/09/2016 | aircraft1 | Pre-Flight
04/09/2016 | aircraft1 | Post-Flight
etc | etc | etc
Is there a way to use the .OrderBy method to achieve this outcome?