Hi Chris,
Javascript can be used to provide the formatting you need.
string DisplayPhone(string s) {
return s.Substring(0,3) + "-" + s.Substring(3,3) + "-" + s.Substring(6);
}
You can call a helper function inside a "<%# %>" construct like so:
<%# DisplayPhone(DataBinder.Eval(Container.DataItem, "Phone", "{0}")) %>
>I am having a little problem understanding the way data formatting expressions work in .NET
>
>I am trying to add formatting to my fields from the grid's properties window. I would like to add formatting to a phone number field to be displayed like this (123) 456-7890
>
>Could you give me a hand with this? Thank you in advance.
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi