Conditional <asp:BoundField

R

Romain Salad

I must admit I probably get less help than from this newsgroup than is
humanly possible, but I thought I'd try again:

In some circumstances I need this:

<asp:BoundField DataField="AMOUNT" HeaderText="AMOUNT"
SortExpression="AMOUNT" DataFormatString="{0:$#,#.##}" HtmlEncode="False"
But when the field is empty, i want to use a different format string. How to
accomplish?
 
G

Guest

You could use the OnDataBound event handler for the control that contains the
bound field then just set the DataFormatString property of the relevent field.
 
P

Patrick.O.Ige

Romain you could also change it to a templatecolumn
and then check it in the codebehind
Patrick
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top