Phone Number in Datagrid

Page 1 of 1

3 Replies - 2505 Views - Last Post: 02 May 2012 - 07:14 PM Rate Topic: -----

#1 issac999  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 22-February 12

Phone Number in Datagrid

Posted 01 May 2012 - 04:08 AM

Hi,

im displaying Phone Number in a Datagrid
<DataGridTextColumn Header="PHONE" Binding="{Binding Path=Phone}"/>


all the numbers are showing as EX:123456789 from the DB
but i would like to show them in US format...

can anyone help me...
Is This A Good Question/Topic? 0
  • +

Replies To: Phone Number in Datagrid

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5475
  • View blog
  • Posts: 11,759
  • Joined: 02-June 10

Re: Phone Number in Datagrid

Posted 01 May 2012 - 06:54 AM

Use a maskedtextbox. Its the first example on the page.
http://wpftoolkit.co...e=MaskedTextBox

If you don't have the extended tool kit installed, you are crippling yourself. There are a LOT of controls in it that seemed to have been forgotten in the first roll out of WPF that are commonplace in WinForms.
Was This Post Helpful? 0
  • +
  • -

#3 issac999  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 22-February 12

Re: Phone Number in Datagrid

Posted 02 May 2012 - 01:45 AM

got the answer from HERE
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: Phone Number in Datagrid

Posted 02 May 2012 - 07:14 PM

You could also use a Value Converter to convert the value to whatever format you want.

You could also use the StringFormat in the binding.

So there are a number of different ways you could handle this.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1