R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Default Sort Order for lists
Last Post 01 Jan 1900 05:00 AM by . 2 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
lnevilleUser is Offline
New Member
New Member
Posts:67

--
23 Sep 2007 09:46 AM  
I want my list to have a default sort order that is based on multiple columns. For example:

order by
U.LastName,
U.FirstName

The list should be re-sortable by the user on any column. The trouble is, if I try to use SORTTAG like this:

order by
[SORTTAG, U.UserID],
U.LastName,
U.FirstName

... and then click the FirstName or LastName columns a SQL error appears:

System.Data.SqlClient.SqlException: A column has been specified more than once in the order by list.

How can I solve this?
bgatesUser is Offline
Basic Member
Basic Member
Posts:196

--
24 Sep 2007 04:17 PM  
When you're defining your {SORT} tags, you can place the default sort order in there. It's the second-to-last parameter. "" will leave it unsorted. "ASC" or "DESC" will sort on that column Ascending or Descending respectively. Initial sort order by the columns is determined by the sort indexer, the final parameter. Remember that the index is just a number, and it doesn't necessarily have to be entered in numerical order - that is, you may want to sort on LastName first, but display FirstName first. In that case, the index for LastName can still be 1, and FirstName 2 even if FirstName is displayed first.
Bob Gates<br>Business Intelligence Force, Inc. (<a href="http://dnn.bi4ce.com"><b>bi4ce</b></a>)
lnevilleUser is Offline
New Member
New Member
Posts:67

--
26 Sep 2007 01:18 PM  
Thanks! This is just what I needed.
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share