Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 14th, 2007, 06:01 PM
Authorized User
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default GridView - Phone column formatting

I have simple ASP2 Web project with page displaying data from BLL (Business Logic Layer).
On web page, GridView binding to BLL object returning ArrayList.

What do I need to display phone column in (###) ###-#### format?
GridView does not have column info at design time, I am binding programatically at runtime

I know, I need to change property BoundField, DataFormatString, HtmlEncode=“false”, etc.

Imar where are you?

Thanks in advance.

Old February 14th, 2007, 06:36 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

I am not sure I fully understand the problem. Why can't you set these properties? Because you don't know where the PhoneNumber will end up?

I think you could do this in code behind when the data is added. Take a look at this thread:


Especially page 2 has some code you may be able to use...

Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM
Phone # field formatting! Nostromo77 ASP.NET 2.0 Basics 3 December 19th, 2006 02:02 PM
formatting phone numbers xslt_student XSLT 0 August 7th, 2006 04:10 PM
Formatting Fields In GridView len1591 ASP.NET 2.0 Basics 2 December 29th, 2005 09:38 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.