|
-
Mar 6th, 2006, 04:57 PM
#1
Thread Starter
Hyperactive Member
Formatting Data in a Gridview?
Currently I run a PROC that populates my Gridview. I know how to format the column widths, fonts etc, and I did some formatting on a date field as follows:
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Font-Names="Arial" Font-Size="9pt" Text='<%# Bind("EFFECTIVE_DATE", "{0:d}") %>'></asp:Label>
</ItemTemplate>
but how do I format a phone number 5555551212 into (555) 555-1212,
Similarly How do I format 2345.3321 into 2,345.33
-
Mar 6th, 2006, 05:10 PM
#2
Re: Formatting Data in a Gridview?
 Originally Posted by seidel1
phone number 5555551212 into (555) 555-1212
Try this one: {0, "(000) 000-0000"}
 Originally Posted by seidel1
Similarly How do I format 2345.3321 into 2,345.33
Try this one: {0, "0.00"}
They should work. You will have to play a bit with the ", I don't have a VS nearby to try them out. Maybe it's without the " , but the format is like that.
HTH
HoraShadow
I do like the reward system. If you find that my post was useful, rate it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|