Replace NULL value with N/A

Posts   
 
    
Posts: 12
Joined: 29-Oct-2009
# Posted on: 29-Oct-2009 22:50:13   

I have NULL values in the database table and would like them to be displayed in GridView as "N/A". The same for int values, value 0 from database should be displayed as "No" and value 1 should be displayed as "Yes" in GridView.

Now I get in GridView:

COLUMN 1 COLUMN 2

1 NULL 0 Some Text 0 More Text

...and I would like to get:

COLUMN 1 COLUMN 2

Yes N/A No Some Text No More Text

How can I do that?

Thanks!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-Oct-2009 01:44:19   

Some Grids have the ability to project some values with default constants per column. For example show 1 as true, 0 as false, NULL as N/A, etc. Please consult the help for the grid control you are using.

You also could opt for your own type converters. LLBLGen comes with a StringBoolean typeConverter. Please read more about this on the documentation. As for N/A I'm not sure if a typeconverter should be wise to use, as N/A is more a GUI representation problem.

David Elizondo | LLBLGen Support Team