Hi,
Sorry for late reply.
For TemplateField, when using Eval or Bind to get the bound data, it can
use another parameter to specify a format string:
<ItemTemplate>
<asp:Label runat="server" ID="lbl1" Text='<%# Eval("value", "{0
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
2}")
%>'></asp:Label>
</ItemTemplate>
However, after I reviewed your question again, I suspect it might still not
work for your case. Since using your "Convert.ToDouble" code on my side
will work correctly, I think it might be related to the data type of the
field "value" in your DataSet.
I've done following test using a VARCHAR field:
1) If I use DataFormatString or Eval/Bind with format string "{0
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
2}", it
will not work, it will still display "0.011".
2) If I use your original code 'Convert.ToDouble("value")) * 100', it
should display "1.1" instead.
Is it possible for you to create a small reproducible project to show this
issue? I will have to have such a project to find the root cause of this
issue. Thank you for your effort and understanding.
Regards,
Walter Wang (
[email protected], remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.