Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6692575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:53:00+00:00 2026-05-26T05:53:00+00:00

I recently discovered the handy little NullDisplayText property for BoundColumns on the GridView control.

  • 0

I recently discovered the handy little NullDisplayText property for BoundColumns on the GridView control. This works great for handling NULL values in my recordset – I can display the placeholder “System” when my username field is NULL, for example.

However, for the SortExpression I can only specify the name of the column, as far as I know. So when I sort by that column it’s still sorting using NULL as the value to sort by instead of my custom value, causing those items to show up first in the list. So my results look like this when I sort:

System
System
Adams
Simpson

Any idea how I can customize the SortExpression behavior to use my custom NullDisplayText value instead of the default NULL? Is this something I just need to handle in my SQL?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:53:00+00:00Added an answer on May 26, 2026 at 5:53 am

    I think it breaks all sorts of rules because it puts sql in the presentation layer, but I must confess that I have used a case statement in the sort expression before:

    SortExpression="CASE WHEN ContactLoginID IS NULL THEN 0 ELSE 1 END"
    

    You could try

    SortExpression="ISNULL(Name, 'System')"
    

    But perhaps you should really do it in the SQL called from the data access layer as you suggested in your question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having recently discovered this method of development, I'm finding it a rather nice methodology.
I recently discovered Python's property built-in , which disguises class method getters and setters
I recently discovered that different browsers handle the onclick event differently when the Control
I recently discovered that 2 == [2] in JavaScript. As it turns out, this
So I recently discovered this Source Mate tool for Flash builder with all the
We recently discovered that the Google Maps API does not play nicely with SSL.
I recently discovered the genshi.builder module. It reminds me of Divmod Nevow's Stan module.
I recently discovered Erlang and am now working my way through a couple of
I recently discovered metaclasses in python. Basically a metaclass in python is a class
I recently discovered that when you have a page set to session readonly and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.