Tks for you reply Morten,
<%# DataBinder.Eval(Container.DataItem, "cfax", "{0:###-###-####}") %>
I try the above code but it's not showing the format in my datagrid and I
don't get any errors...
Any ideas??
Rgds
JFB
Hi JFB,
I'm sure there is a better method, and using DataBinder.Eval you should be
able to format the number using something like
[C#]
<%# DataBinder.Eval(Container.DataItem, "cfax", "{0:###-###-####}") %>
However, I was unable to properly format the number that way so an
alternative method is to call a method that formats the number.
[C#]
<%# Format(DataBinder.Eval(Container.DataItem, "fax")) %>
Where Format is defined as
public string Format(object value)
{
long n = Convert.ToInt64(value);
return n.ToString("###-###-####");
}
Hi all,
How can I format a fax number as 888-333-444?
The number is coming from database as 8883334444
<ItemTemplate>
<%#container.dataItem("cfax")%>
</ItemTemplate>
Tks
JFB