<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx</link><description>As you can probably tell from my last couple posts I've been working with WPF in different data scenarios. Yesterday I was playing with data validation in WPF and .NET 3.5 which is pretty slick. In this article I'll walk through how to hook up validation</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#10376121</link><pubDate>Mon, 10 Dec 2012 17:47:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10376121</guid><dc:creator>Matt P.</dc:creator><description>&lt;p&gt;Thank very much, this is extremely helpful. &amp;nbsp;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10376121" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#10362255</link><pubDate>Wed, 24 Oct 2012 05:05:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10362255</guid><dc:creator>Admin</dc:creator><description>&lt;p&gt;Here also one WPF validation example with code is available&lt;/p&gt;
&lt;p&gt;Its contain the combobox validation also&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://wpftutorial.co.in/WPFValidation/WPFValidationPart1.aspx"&gt;wpftutorial.co.in/.../WPFValidationPart1.aspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10362255" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#10174902</link><pubDate>Wed, 15 Jun 2011 15:56:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10174902</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;@espinete - it&amp;#39;s pretty old but I think this has a sample:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://archive.msdn.microsoft.com/formsoverlinq"&gt;archive.msdn.microsoft.com/formsoverlinq&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;-Beth&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10174902" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#10173845</link><pubDate>Mon, 13 Jun 2011 09:59:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10173845</guid><dc:creator>espinete</dc:creator><description>&lt;p&gt;Where is the sample source code about it ??? thx&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10173845" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#10117805</link><pubDate>Wed, 19 Jan 2011 19:46:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10117805</guid><dc:creator>Louis Nardozi</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;Got somewhere with this after jillions of problems displaying validation messages. Take a look at this ValidationToolTipTemplate&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;ControlTemplate x:Key=&amp;quot;ValidationToolTipTemplate&amp;quot; &amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Grid x:Name=&amp;quot;root&amp;quot; Margin=&amp;quot;5,0&amp;quot; RenderTransformOrigin=&amp;quot;0,0&amp;quot; Opacity=&amp;quot;0&amp;quot; &amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;Grid.RenderTransform&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;TranslateTransform x:Name=&amp;quot;xform&amp;quot; X=&amp;quot;-25&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;/Grid.RenderTransform&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;VisualStateManager.VisualStateGroups&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;VisualStateGroup Name=&amp;quot;OpenStates&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;					&amp;lt;VisualStateGroup.Transitions&amp;gt;&lt;/p&gt;
&lt;p&gt;						&amp;lt;VisualTransition GeneratedDuration=&amp;quot;0&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;						&amp;lt;VisualTransition To=&amp;quot;Open&amp;quot; GeneratedDuration=&amp;quot;0:0:0.2&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;							&amp;lt;Storyboard&amp;gt;&lt;/p&gt;
&lt;p&gt;								&amp;lt;DoubleAnimation Storyboard.TargetName=&amp;quot;xform&amp;quot; Storyboard.TargetProperty=&amp;quot;X&amp;quot; To=&amp;quot;0&amp;quot; Duration=&amp;quot;0:0:0.2&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;									&amp;lt;DoubleAnimation.EasingFunction&amp;gt;&lt;/p&gt;
&lt;p&gt;										&amp;lt;BackEase Amplitude=&amp;quot;.3&amp;quot; EasingMode=&amp;quot;EaseOut&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;									&amp;lt;/DoubleAnimation.EasingFunction&amp;gt;&lt;/p&gt;
&lt;p&gt;								&amp;lt;/DoubleAnimation&amp;gt;&lt;/p&gt;
&lt;p&gt;								&amp;lt;DoubleAnimation Storyboard.TargetName=&amp;quot;root&amp;quot; Storyboard.TargetProperty=&amp;quot;Opacity&amp;quot; To=&amp;quot;1&amp;quot; Duration=&amp;quot;0:0:0.2&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;							&amp;lt;/Storyboard&amp;gt;&lt;/p&gt;
&lt;p&gt;						&amp;lt;/VisualTransition&amp;gt;&lt;/p&gt;
&lt;p&gt;					&amp;lt;/VisualStateGroup.Transitions&amp;gt;&lt;/p&gt;
&lt;p&gt;					&amp;lt;VisualState x:Name=&amp;quot;Closed&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;						&amp;lt;Storyboard&amp;gt;&lt;/p&gt;
&lt;p&gt;							&amp;lt;DoubleAnimation Storyboard.TargetName=&amp;quot;root&amp;quot; Storyboard.TargetProperty=&amp;quot;Opacity&amp;quot; To=&amp;quot;0&amp;quot; Duration=&amp;quot;0&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;						&amp;lt;/Storyboard&amp;gt;&lt;/p&gt;
&lt;p&gt;					&amp;lt;/VisualState&amp;gt;&lt;/p&gt;
&lt;p&gt;					&amp;lt;VisualState x:Name=&amp;quot;Open&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;						&amp;lt;Storyboard&amp;gt;&lt;/p&gt;
&lt;p&gt;							&amp;lt;DoubleAnimation Storyboard.TargetName=&amp;quot;xform&amp;quot; Storyboard.TargetProperty=&amp;quot;X&amp;quot; To=&amp;quot;0&amp;quot; Duration=&amp;quot;0&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;							&amp;lt;DoubleAnimation Storyboard.TargetName=&amp;quot;root&amp;quot; Storyboard.TargetProperty=&amp;quot;Opacity&amp;quot; To=&amp;quot;1&amp;quot; Duration=&amp;quot;0&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;						&amp;lt;/Storyboard&amp;gt;&lt;/p&gt;
&lt;p&gt;					&amp;lt;/VisualState&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;/VisualStateGroup&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;/VisualStateManager.VisualStateGroups&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;Border Margin=&amp;quot;4,4,-4,-4&amp;quot; Background=&amp;quot;#052A2E31&amp;quot; CornerRadius=&amp;quot;5&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;Border Margin=&amp;quot;3,3,-3,-3&amp;quot; Background=&amp;quot;#152A2E31&amp;quot; CornerRadius=&amp;quot;4&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;Border Margin=&amp;quot;2,2,-2,-2&amp;quot; Background=&amp;quot;#252A2E31&amp;quot; CornerRadius=&amp;quot;3&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;Border Margin=&amp;quot;1,1,-1,-1&amp;quot; Background=&amp;quot;#352A2E31&amp;quot; CornerRadius=&amp;quot;2&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;Border Background=&amp;quot;#FFDC000C&amp;quot; CornerRadius=&amp;quot;2&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;Border CornerRadius=&amp;quot;2&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ListBox MaxHeight=&amp;quot;450&amp;quot; ScrollViewer.VerticalScrollBarVisibility=&amp;quot;Auto&amp;quot; ScrollViewer.HorizontalScrollBarVisibility=&amp;quot;Disabled&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UseLayoutRounding=&amp;quot;True&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Foreground=&amp;quot;White&amp;quot; Background=&amp;quot;Transparent&amp;quot; Margin=&amp;quot;8,4,8,4&amp;quot; ItemsSource=&amp;quot;{Binding (Validation.Errors),BindsDirectlyToSource=True}&amp;quot; &amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ListBox.ItemTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;DataTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;TextBlock IsHitTestVisible=&amp;quot;False&amp;quot; MaxWidth=&amp;quot;240&amp;quot; Text=&amp;quot;{Binding ErrorContent}&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/DataTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/ListBox.ItemTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/ListBox&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Border&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;/Grid&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;/ControlTemplate&amp;gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10117805" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#10039071</link><pubDate>Fri, 16 Jul 2010 11:55:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10039071</guid><dc:creator>Moorzee</dc:creator><description>&lt;p&gt;Hi Beth&lt;/p&gt;
&lt;p&gt;Do you have any idea how I would have datagrid in my usercontrol set a &amp;quot;HasErrors&amp;quot; dependancy property in the same usercontrol when invalid data is entered in a datagridrow?&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;Paul.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10039071" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#9991990</link><pubDate>Wed, 07 Apr 2010 20:44:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9991990</guid><dc:creator>Tanner</dc:creator><description>&lt;p&gt;I'm trying to follow along with this article using the wpf datagrid and I am having some issues:&lt;/p&gt;
&lt;p&gt;1. When I moved my error style to the application.xaml file I started getting &lt;/p&gt;
&lt;p&gt;&amp;quot;Cannot convert the value in attribute 'ErrorTemplate' to object of type 'System.Windows.Controls.ControlTemplate'. 'System.Windows.Style' is not a valid value for property 'ErrorTemplate'. &amp;nbsp;Error at object 'Microsoft.Windows.Controls.DataGridTextColumn&amp;quot;. Any tips to track down cryptic messages like this one?&lt;/p&gt;
&lt;p&gt;2. I am not sure how I am overriding the default ErrorTemplate? According to this article I only need to set up the style in the app.resources but not actually do a Validation.ErrorTemplate=&amp;quot;{StaticResource myErrorTemplate}&amp;quot; on my control which I wish to implement this? Only setting the &amp;quot;ValidateOnDataError=True&amp;quot; will do this for me?&lt;/p&gt;
&lt;p&gt;3. I have manually set the UpdateSourceTrigger=&amp;quot;PropertyChanged&amp;quot; on my column which I am assigning the errortemplate to yet I have to tab away or hit enter to see any UI changes. In debug mode I watched my base class of items call SendPropertyChanging and SendPropertyChanged so I am not sure what I am doing wrong? I used linq-sql classes to get my dataclasses. I found another sample project from &lt;a rel="nofollow" target="_new" href="http://www.thejoyofcode.com/Reason_10._Validation.aspx"&gt;http://www.thejoyofcode.com/Reason_10._Validation.aspx&lt;/a&gt; and it validates as soon as I stop typing or empty the textbox. How can I get that functionality? (Again, I am using datagrid not a textbox)&lt;/p&gt;
&lt;p&gt;I'm almost all squared away for a nice grid with in-place edits and validation if I can just get the validation to work.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9991990" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#9854517</link><pubDate>Fri, 31 Jul 2009 19:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9854517</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Sharf,&lt;/p&gt;
&lt;p&gt;Take a look at this video series, especially # 9 on how to add validation on datasets to Windows forms. &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx#formsoverdata"&gt;http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx#formsoverdata&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The datagridview will automatically display the error when you tab off the field. If you have more questions please visit the forums: &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://social.msdn.microsoft.com/Forums/en-US/category/visualbasic"&gt;http://social.msdn.microsoft.com/Forums/en-US/category/visualbasic&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9854517" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#9853619</link><pubDate>Thu, 30 Jul 2009 21:30:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9853619</guid><dc:creator>Sharf</dc:creator><description>&lt;p&gt;Hmm...! That is not exactly what I mean. Actually, I drag &amp;amp; drop Dataset source with DetailsView selected to Winform. So it is already bounded textbox. I need this textbox should validate from Dataset partial class when the user keypress or anyother event. Got it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9853619" width="1" height="1"&gt;</description></item><item><title>re: Displaying Data Validation Messages in WPF</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/06/27/displaying-data-validation-messages-in-wpf.aspx#9853516</link><pubDate>Thu, 30 Jul 2009 19:28:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9853516</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Sharf,&lt;/p&gt;
&lt;p&gt;Sorry I assumed WPF because this discussion is about Validation messages in WPF. Take a look at this article in the MSDN library:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/aa480734.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa480734.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9853516" width="1" height="1"&gt;</description></item></channel></rss>