Display alternate text in datagrid

J

Jason .

I have a datagrid that has a boundcolumn to my database:

<asp:BoundColumn DataField="IndustryPercentile" HeaderText="Industry"
DataFormatString="{0:###}%">
</asp:BoundColumn>

When a IndustryPercentile value is not available, the data returned is
-1. I would like to display "n/a" when the IndustryPercentile is -1.
How can I do this?
 
E

Eliyahu Goldin

Handle ItemDataBound event. If the cell text = "-1", replace it with "n/a".

Eliyahu
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top