Unusual sort in datagrid

Discussion in 'ASP .Net Datagrid Control' started by Jim Nugent, Sep 16, 2003.

  1. Jim Nugent

    Jim Nugent Guest

    Hello,
    I have a requirement to sort a column in a datagrid (bound to a dataview)
    that may contain blanks. The data needs to be in ascending order with the
    blanks at the end. Unfortunately, the standard sort algorithm thinks a blank
    or null is "less than" anything else so they end up at the top.

    I've thought of sorting, and then checking for blanks and stuffing them in
    at the end until I hit a non-blank, but I'm not sure how to do this with a
    dataset, and i'm not sure when the sorting actually occurs (probably NOT as
    soon as dataView.Sort is set to an expression). Probably on DataBind().

    I've also considered adding a hidden column in which blanks are replaced by
    strings filled with the "heaviest" character (Z?) and sorting on that.

    Can anyone think of anything more elegant?
    Thanks in advance
    --
    Jim
    "Remember, an amateur built the Ark; professionals built the Titanic."
     
    Jim Nugent, Sep 16, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Duke of Hazard

    newbie: unusual email output

    Duke of Hazard, Jan 21, 2004, in forum: Perl
    Replies:
    4
    Views:
    762
  2. William A. Sempf

    Unusual performance problem.

    William A. Sempf, Aug 27, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    379
    William A. Sempf
    Aug 27, 2003
  3. Farooq Khan
    Replies:
    3
    Views:
    443
    Jim Cheshire [MSFT]
    Oct 24, 2003
  4. Marty McDonald

    SoapException - unusual behavior

    Marty McDonald, May 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    689
    Marty McDonald
    May 19, 2004
  5. Navin
    Replies:
    1
    Views:
    744
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page