Thank you.
But why does html-encoding occur before applying the format
string? It seems
to me like a bug.
-----Original Message-----
From: Discussion of building .NET applications targeted for
the Web
[mailto OTNET-WE
B DISCUSS.DEVELOP.COM] On Behalf Of Marc Brooks
Sent: Wednesday, March 29, 2006 15:29
To: DOTNET-WEB DISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-WEB] BoundField.DataFormatString is
being ignored?
> I have GridView with the following bound field:
>
> <asp:BoundField DataField="Size"
HeaderText="Size" ReadOnly="True"
> SortExpression="Size"
DataFormatString="{0:X}" >
</asp:BoundField>
>
> It renders 25, not 19 as I expect. Has anyone else seen
this?
Yes, and it's pretty well documented. You need to turn off
HTML encoding of
the field, which hoses the formatting..
Use this:
<asp:BoundField DataField="Size"
HeaderText="Size" ReadOnly="True"
SortExpression="Size"
DataFormatString="{0:X}"
HtmlEncode="False"
</asp:BoundField>
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|