views:

182

answers:

1

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!

A: 

You can check the value of the row in the GridView row bound event and set it as "System" there. Set the Sorting expression as the column name.

Not an expert but this is kinda workaround. Don't know how to customize the Sort Expression.

hozefam