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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top