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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top