I have a datalist that shows information from a SQL table perfectly. Is there a way to show the information in reverse order?
Example:
Person1 Person2 Person3
Instead I would like:;
Person3 Person2 Person1
I have a datalist that shows information from a SQL table perfectly. Is there a way to show the information in reverse order?
Example:
Person1 Person2 Person3
Instead I would like:;
Person3 Person2 Person1
If you don't want to do it server-side you could also use the Reverse
extension method:
var items = myDataList.Items;
myDataList.Items = items.Reverse();
or more succinctly, but less obvious:
myDataList.Items = myDataList.Items.Reverse();