<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programming with .NET - General</title><link>http://forums.silverlight.net/forums/17.aspx</link><description>General discussions around authoring Silverlight .NET applications.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: Re: Re: Custom date format in DatePicker in Beta 2.0</title><link>http://forums.silverlight.net/forums/thread/198004.aspx</link><pubDate>Mon, 30 Mar 2009 14:14:28 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:198004</guid><dc:creator>David H</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/198004.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=198004</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve found the answer why setting the ShortDatePattern = &amp;quot;dd/MMM/yyyy&amp;quot; does not work.&amp;nbsp; It turns out that it needs to have the escape character &amp;quot;\&amp;quot;&amp;nbsp;the for slash &amp;quot;/&amp;quot; in the format string.&amp;nbsp; Once I change to the following, it works&lt;/p&gt;
&lt;p&gt;Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = &amp;quot;dd\/MMM\/yyyy&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;</description></item><item><title>Re: Re: Custom date format in DatePicker in Beta 2.0</title><link>http://forums.silverlight.net/forums/thread/196789.aspx</link><pubDate>Fri, 27 Mar 2009 13:42:26 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:196789</guid><dc:creator>David H</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/196789.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=196789</wfw:commentRss><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m running Silverlight 2.0 and my machine&amp;#39;s regional setting date format is set to M/dd/yyyy, when I run the following&amp;nbsp;code, it returns the correct format in Silverlight as I specify.&lt;/p&gt;
&lt;p&gt;Thread.CurrentThread.CurrentCulture = new CultureInfo(&amp;quot;en-us&amp;quot;);&lt;/p&gt;
&lt;p&gt;Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = &amp;quot;dd-MMM-yyyy&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;However, when I change my machine&amp;#39;s regional setting date format to M-dd-yyyy and run the following code, it does not returns the correct format as I specify.&lt;/p&gt;
&lt;p&gt;Thread.CurrentThread.CurrentCulture = new CultureInfo(&amp;quot;en-us&amp;quot;);&lt;/p&gt;
&lt;p&gt;Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = &amp;quot;dd/MMM/yyyy&amp;quot;;&lt;/p&gt;
&lt;p&gt;Instead, it returns 09-Mar-2009 and looks like it still use the Date Separator from regional settings.&amp;nbsp; Did I do anything wrong here?&amp;nbsp; Or is it a bug in Silverlight 2.0?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;</description></item><item><title>Re: Re: Custom date format in DatePicker in Beta 2.0</title><link>http://forums.silverlight.net/forums/thread/155856.aspx</link><pubDate>Mon, 05 Jan 2009 07:18:53 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:155856</guid><dc:creator>Amanda Wang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/155856.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=155856</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi &lt;strong&gt;kent,&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt; You can try to add the namespace
using System.Globalization; using System.Threading; in the app.xaml.cs
file, and add below two lines code in the Application_Startup event:&lt;/p&gt;&lt;p&gt;&amp;nbsp; Thread.CurrentThread.CurrentCulture = new CultureInfo(&amp;quot;en-GB&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;
Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = &amp;quot;dd-MMM-yyyy&amp;quot;;&lt;/p&gt;&lt;p&gt;&amp;nbsp;for example:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&amp;nbsp;private void Application_Startup(object sender, StartupEventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.CurrentThread.CurrentCulture = new CultureInfo(&amp;quot;en-GB&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = &amp;quot;dd-MMM-yyyy&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.RootVisual = new Page();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }</description></item><item><title>Re: Re: Custom date format in DatePicker in Beta 2.0</title><link>http://forums.silverlight.net/forums/thread/145923.aspx</link><pubDate>Thu, 11 Dec 2008 09:57:50 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:145923</guid><dc:creator>virendrakr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/145923.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=145923</wfw:commentRss><description>Hi Amanda,

I tried it in Silverlight 2. It did not work.

My system date format is &amp;quot;dd-MMM-yyyy&amp;quot; and i am trying to format it in &amp;quot;MM/dd/yyyy&amp;quot; format.

This SelectedDateChange event was falling in loop therefore i used CalenderClosed event but no luck.

Thanks</description></item><item><title>Re: Re: Custom date format in DatePicker in Beta 2.0</title><link>http://forums.silverlight.net/forums/thread/135032.aspx</link><pubDate>Fri, 21 Nov 2008 06:56:40 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:135032</guid><dc:creator>jcmoore0</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/135032.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=135032</wfw:commentRss><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;I hope they add a custom formatter property to the&amp;nbsp;DatePicker other than just (Long, Short)&lt;/p&gt;
&lt;p&gt;I was&amp;nbsp;not able to&amp;nbsp;use the SelectedDateChanged for formatting because&amp;nbsp;Editing&amp;nbsp;causes changes&amp;nbsp;before Editing is completed.&amp;nbsp;&amp;nbsp; I tried LostFocus but it continuously looped during my test.&amp;nbsp;&amp;nbsp; I think it may be a known issue with LostFocus.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;</description></item><item><title>Re: Custom date format in DatePicker in Beta 2.0</title><link>http://forums.silverlight.net/forums/thread/132171.aspx</link><pubDate>Mon, 17 Nov 2008 08:16:29 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:132171</guid><dc:creator>Amanda Wang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/132171.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=132171</wfw:commentRss><description>&lt;p&gt;Hi Pratik&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;We have a test on our labs with the silverlight RTW.&lt;/p&gt;
&lt;p&gt;private void picker_Loaded(object sender, RoutedEventArgs e)// the datapicker&amp;#39;s load event.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.picker.Text = DateTime.Now.ToString(&amp;quot;dd-MMM-yyyy&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void picker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.picker.Text = this.picker.SelectedDate.Value.ToString(&amp;quot;dd-MMM-yyyy&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;If you add the&amp;nbsp;code: &amp;nbsp;this.picker.Text = this.picker.SelectedDate.Value.ToString(&amp;quot;dd-MMM-yyyy&amp;quot;); to the datapicker;s SelectedDateChanged event, you can get the correct date formate in the load event.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Custom date format in DatePicker in Beta 2.0</title><link>http://forums.silverlight.net/forums/thread/130117.aspx</link><pubDate>Thu, 13 Nov 2008 07:02:38 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:130117</guid><dc:creator>preishuber</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/130117.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=130117</wfw:commentRss><description>&lt;p&gt;as silverlight 2 is unsuported in all beta editions i suggest you to change to RTW bits and then take the toolkit &lt;a href="http://www.codeplex.com/Silverlight"&gt;http://www.codeplex.com/Silverlight&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Source code is included&lt;/p&gt;</description></item><item><title>Custom date format in DatePicker in Beta 2.0</title><link>http://forums.silverlight.net/forums/thread/130115.aspx</link><pubDate>Thu, 13 Nov 2008 06:58:54 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:130115</guid><dc:creator>pthakkar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/130115.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=130115</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;&lt;p&gt;I am trying to set my custom date format like dd-MMM-yyyy to datepicker control in silverlight 2 beta 2.&lt;/p&gt;&lt;p&gt;I have tried as following way:&lt;/p&gt;&lt;p&gt; datepicker.SelectedDate = DateTime.Today;&lt;/p&gt;&lt;p&gt; datepicker.Text =&amp;nbsp; datepicker.SelectedDate.Value.ToString(&amp;quot;dd-MMM-yyyy&amp;quot;); &lt;/p&gt;&lt;p&gt;on load event of it. But fail to get current date in formate like 13-Nov-2008.&lt;/p&gt;&lt;p&gt;I need help here..&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;Pratik&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>