Working with Access Databases in Microsoft Expression WebHow to format a Telephone Number field in an ASP.NET GridViewThis assumes your telephone number is stored in a Text field in your Access Database. In this example, my field name is "homephone". Common GridView Tasks > Edit Columns Select the field containing the phone number from the Selected fields list. Click the Convert this field into a TemplateField link. Click OK. Switch to Code View. Find the generated code for the phone number field: <asp:templatefield SortExpression="homephone" HeaderText="homephone"> In the ItemTemplate node (highlighted above in blue), select the code highlighted above in yellow and replace it with this code: <%# String.Format("{0:(###) ###-####}",Convert.ToInt64(DataBinder.Eval(Container.DataItem, "homephone")))%> Save your page and preview in browser. Code found at Dev::Blog and tweaked a bit. Back to Working with Access Databases in Microsoft Expression Web |