[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3014
  • Last Modified:

dataformatstring for phone number

Hi,

What is the dataformatstring property supposed to like for a phone number on a bound column in a datagrid? T

The format I need is (###) ###-####

<asp:BoundColumn HeaderText="Phone" Visible="True" DataField="intPhoneNumber" ItemStyle-Width="60" readOnly="True" ItemStyle-HorizontalAlign="Center" DataFormatString=""/>
0
Gezna
Asked:
Gezna
1 Solution
 
David H.H.LeeCommented:
Gezna ,
Try this :
<asp:BoundColumn HeaderText="Phone" Visible="True" DataField="intPhoneNumber" ItemStyle-Width="60" readOnly="True" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:(###) ###-####}"/>

Check this article :
-http://aspnet.4guysfromrolla.com/articles/041702-1.2.aspx
0
 
GeznaAuthor Commented:
thanks! I knew I could find it if I looked hard enough, but I just didn't have time
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now