Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DataFormatString on boundcolumn not working

Reply
Thread Tools

DataFormatString on boundcolumn not working

 
 
Aaron
Guest
Posts: n/a
 
      04-15-2004
Why doesn't the following code display a ten-digit number in the format
123-456-7890?

How can I format a ten-digit number as a telephone number?

<asp:BoundColumn DataFormatString="{0:###-###-####}"
DataField="Client_BPhone" HeaderText="BPhone">
<ItemStyle Width="200px"></ItemStyle>
</asp:BoundColumn>

The width is working, I can change border sizes, but I am unable to format
the string.

Any help would be appreciated.

Thanks,
Aaron
 
Reply With Quote
 
 
 
 
Michael Tkachev
Guest
Posts: n/a
 
      04-16-2004
May by you need to try to use ItemTemplate.

<%# (DataBinder.Eval(Container.DataItem,
"ColName")).ToString("000-000-0000")%>

Try to do it.

"Aaron" <(E-Mail Removed)> wrote in message
news:Xns94CCA7037FD44aaronjonharveycom1@207.46.248 .16...
> Why doesn't the following code display a ten-digit number in the format
> 123-456-7890?
>
> How can I format a ten-digit number as a telephone number?
>
> <asp:BoundColumn DataFormatString="{0:###-###-####}"
> DataField="Client_BPhone" HeaderText="BPhone">
> <ItemStyle Width="200px"></ItemStyle>
> </asp:BoundColumn>
>
> The width is working, I can change border sizes, but I am unable to format
> the string.
>
> Any help would be appreciated.
>
> Thanks,
> Aaron



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boundcolumn or TemplateField when to use Boundcolumn and when TemplateField ???? mesut ASP .Net 0 06-29-2007 10:17 AM
How to set BoundColumn DataFormatString in CodeBehind? Randall Parker ASP .Net 1 12-12-2005 07:16 AM
August CTP DataFormatString in Gridview not working Gerhard Pretorius ASP .Net 3 09-22-2005 06:40 AM
Format Double Values using BoundColumn.DataFormatString Prasad Dannani ASP .Net Datagrid Control 1 06-27-2005 12:07 PM
BoundColumn - DataFormatString in a Multicutural Manner cntams@gmail.com ASP .Net 0 03-31-2005 08:16 PM



Advertisments