How to use Data Formatting Expression?

D

Dexter

Hello all,
I have a DataGrid in my Web Application, and it contains a column that i
need to format.
The data is 03856219000126 and i need to show as 03.856.219/0001-26.

Somebody can help me with this?


Thanks



Dexter
 
G

Guest

A few ways to go, but I like from within the databinding expression something
like MyFormatter(myString), where MyFormatter is a public method on the page
that takes a string, runs code to do the formatting, and returns the
formatted string. Or, if the datasource for the grid is your own collection,
you can add a public readonly property to the collection, e.g.
MyFormattedString, which returns the string the way you want it. Finally, if
your input string is numeric and is always in the same format, you can use a
custom numeric formatting string.
 

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
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top