Professional Web Applications Themes

Weird Sort criteria - ASP.NET Data Grid Control

The dataView has the following columns: CodeType, Code, Description, Amount, CodeDate CodeType can have the following values:'BK','BJ','ZZ','BN','BF','BR','BP','BO','BQ ','BI','BH'.... I want records to be displayed in the grid in the order of CodeType I have listed above. As you can see, ASC or DESC will not work. How can I do it, either in the SQL or in the code - javacript or C#?...

  1. #1

    Default Weird Sort criteria

    The dataView has the following columns:
    CodeType, Code, Description, Amount, CodeDate

    CodeType can have the following
    values:'BK','BJ','ZZ','BN','BF','BR','BP','BO','BQ ','BI','BH'....

    I want records to be displayed in the grid in the order of CodeType I
    have listed above. As you can see, ASC or DESC will not work. How can
    I do it, either in the SQL or in the code - javacript or C#?
    Rathtap Guest

  2. #2

    Default Re: Weird Sort criteria

    On 2 Jul 2004 07:16:29 -0700, [email]amcniw[/email] (Rathtap) wrote:
    >The dataView has the following columns:
    >CodeType, Code, Description, Amount, CodeDate
    >
    >CodeType can have the following
    >values:'BK','BJ','ZZ','BN','BF','BR','BP','BO','B Q','BI','BH'....
    >
    >I want records to be displayed in the grid in the order of CodeType I
    >have listed above. As you can see, ASC or DESC will not work. How can
    >I do it, either in the SQL or in the code - javacript or C#?
    You will need to add another field to your underlying dataset and sort
    by that column when they choose to sort by the codetype column. The
    new column could be numeric values.

    ie

    bk=0
    bj=1
    zz=2
    bn=3
    ...

    -Adam
    ashelley@inlandkwpp.com Guest

Similar Threads

  1. FLV Issue...and it's weird weird weird
    By boxdoctor in forum Macromedia Flash Flashcom
    Replies: 2
    Last Post: June 8th, 05:54 PM
  2. Changing Sort criteria of DB table.
    By juniorbee in forum Dreamweaver AppDev
    Replies: 3
    Last Post: February 23rd, 11:53 PM
  3. Weird bug....sort of.
    By Scott_K.@adobeforums.com in forum Adobe Indesign Windows
    Replies: 4
    Last Post: May 10th, 03:10 PM
  4. memory sort and disk sort
    By dusong in forum Informix
    Replies: 4
    Last Post: October 24th, 02:11 PM
  5. Replies: 1
    Last Post: September 9th, 07:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139