Keep data with specific value on top when sorting a gridview

Posted by aspNetAficionado on Stack Overflow See other posts from Stack Overflow or by aspNetAficionado
Published on 2009-10-05T19:47:34Z Indexed on 2010/04/30 8:07 UTC
Read the original article Hit count: 209

Filed under:
|

Hi i have a gridview with information about documents: name, document type (policy, guidelines, forms, etc), category, etc. I want to sort the gridview alphabetically (name) and by document type, but always having the 'policy' above the other document types when document name is the same. How do I do that?

eg If I do sort by DocumentName, DocumentType ('policy' maybe not be the first one in the list) but if I do sort by DocumentType , DocumentName (I would get for example all guidelines first in alphabetical order, then procedures, then policies, etc)

© Stack Overflow or respective owner

Related posts about gridview

Related posts about ASP.NET