c# - GridView how to apply string format to item -
I have the following code in the column section of my gridview:
& lt; Columns & gt; & Lt; ASP: Boundfield Datafield = "nominal-compliant" header text = "nomination normal" /> & Lt; ASP: Boundfield Datafield = "AAL" headtext = "AAL" sortedExposition = "Aual" /> & Lt; ASP: Boundfield Datafield = "Semestrial" headertext = "semestrial" data format string = "{0: 0.00}" /> & Lt; Asp: BoundfieldDefined = "Tertium" HeadText = "Semestral" htmlnx = "incorrect" data format string = "{0: 00.0000}" /> & Lt; ASP: Boundfield datedfield = "funny" header text = "funny" /> & Lt; / Column & gt;
This gridview is a feed from a data that is all the datacolom string type.
My problem is that DataFormatString is not being applied and I do not know why.
I want to get lots of decimal points in all columns, including data formatstostings.
What's going on?
Thanks in advance.
> Best Relationship
Try
& lt; ASP: Boundfield Datafield = "Semesteral" headertext = "Semestrial" dataformat string = "{0: 0.00}" htmlnx = "fottal" />
I'm having this because (and correct me if I'm wrong) Field Value is HtmlEncoded There is no effect before formatting the format.
Feedback to the comment:
You can try to use the RwDataBound event.
The Road DataBound event is picked up when a data line (represented by a GridviewerObject object) is bound to the data in gridview control. This enables you to provide an event-handling method that makes a custom routine, such as modifying the value of bound data for the line, whenever this event happens.
Comments
Post a Comment