﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Phone number format in display member?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 29 May 2026 11:29:44 GMT</lastBuildDate><ttl>20</ttl><item><title>Phone number format in display member?</title><link>http://forum.strataframe.net/FindPost6625.aspx</link><description>I am trying to put a formatted phone number in part of the drop-down's display value, and am having no luck.&amp;nbsp; In the ComboBox's PopulationDataSourceSettings dialog, I can set a display member format string.&amp;nbsp; What would I put in here to make "1234567890" display as "(123) 456-7890"?&amp;nbsp; I know you can use things like {0:c} to display currency or {0:d2} to display a given precision, and so on.&amp;nbsp; I'm just at a loss as to what I can use here to display a phone number.&amp;nbsp; Also, one other thing to consider is international numbers.&amp;nbsp; What if this number is formatted differently for different instances?</description><pubDate>Fri, 09 Feb 2007 15:32:22 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Phone number format in display member?</title><link>http://forum.strataframe.net/FindPost6672.aspx</link><description>Every control has a DataBindings collection... the first element of which should contain the Binding object that we create and attach to the control.&amp;nbsp; The Binding object itself has a Format event that is raised when the data is being copied into the control.&amp;nbsp; You can handle the Format event and modify the value within the event args and programmatically change the value that is being sent to the control.&lt;/P&gt;&lt;P&gt;You'll also have to bind to the DataBindings.CollectionChanged event so you attach to the Format event of any new binding that is added to the collection.&amp;nbsp; For an example on how to do this, you can check the Infragistics wrapper's UltraDateTimeEditor... I had to handle the Format to get the date to display NULL values properly.</description><pubDate>Fri, 09 Feb 2007 15:32:22 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Phone number format in display member?</title><link>http://forum.strataframe.net/FindPost6652.aspx</link><description>This is actually a DevExpress inherited combo box.&amp;nbsp; Not sure how to do it with this one.&amp;nbsp; I know how you can do this with the grid on the CustomColumnDisplayText, but it's not quite the same with the combo.</description><pubDate>Thu, 08 Feb 2007 13:49:46 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Phone number format in display member?</title><link>http://forum.strataframe.net/FindPost6651.aspx</link><description>I believe you can place in the validation event so it would perform the update following entry. By the way, Infragistics has one that will preformat prior to entry and even allow for extensions!</description><pubDate>Thu, 08 Feb 2007 12:27:55 GMT</pubDate><dc:creator>Michael Reese</dc:creator></item><item><title>RE: Phone number format in display member?</title><link>http://forum.strataframe.net/FindPost6650.aspx</link><description>I may be asking a stupid question, but how do you populate a specific part of the display through an event?</description><pubDate>Thu, 08 Feb 2007 11:14:18 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Phone number format in display member?</title><link>http://forum.strataframe.net/FindPost6641.aspx</link><description>I would populate that column through an event and then use a RegEx pattern to split the phone number into parts.&amp;nbsp; For example, your pattern and replacement would look something like this:&lt;/P&gt;&lt;P&gt;[codesnippet]Imports System.Text.RegularExpressions&lt;/P&gt;&lt;P&gt;MsgBox(Regex.Replace("1231234567", "(\d{3})(\d{3})(\d{4})", "($1) $2-$3"))[/codesnippet]</description><pubDate>Thu, 08 Feb 2007 09:28:52 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>